|
@@ -24,30 +24,33 @@ import { useFocusEffect } from "@react-navigation/native";
|
|
|
import ScrollPage from "../components/ScrollPage";
|
|
import ScrollPage from "../components/ScrollPage";
|
|
|
import ConnectButton from "../components/ConnectButton";
|
|
import ConnectButton from "../components/ConnectButton";
|
|
|
import GuideHeaderBar from "../components/GuideHeaderBar";
|
|
import GuideHeaderBar from "../components/GuideHeaderBar";
|
|
|
-import OpenTime from "../components/OpenTime";
|
|
|
|
|
|
|
+import Textarea from "react-native-textarea";
|
|
|
|
|
|
|
|
export default function Guide1Screen({ navigation, route }) {
|
|
export default function Guide1Screen({ navigation, route }) {
|
|
|
const theme = useTheme();
|
|
const theme = useTheme();
|
|
|
const { changeBackground } = useModel("barModel");
|
|
const { changeBackground } = useModel("barModel");
|
|
|
const { setNavigation, pushRouter } = useModel("routersModel", true);
|
|
const { setNavigation, pushRouter } = useModel("routersModel", true);
|
|
|
const { httpGet } = useModel("httpModel", true);
|
|
const { httpGet } = useModel("httpModel", true);
|
|
|
- const { registerSecend } = useModel("userModel", true);
|
|
|
|
|
|
|
+ const { registerSecend, changeGuideStep } = useModel("userModel", true);
|
|
|
|
|
|
|
|
const {
|
|
const {
|
|
|
- guideHome_title1,
|
|
|
|
|
|
|
+ guide1_title1,
|
|
|
guideHome_title2,
|
|
guideHome_title2,
|
|
|
- guideHome_form_1,
|
|
|
|
|
- guideHome_form_2,
|
|
|
|
|
- guideHome_form_3,
|
|
|
|
|
- guideHome_form_4,
|
|
|
|
|
- guideHome_form_5,
|
|
|
|
|
- guideHome_form_6,
|
|
|
|
|
- guideHome_form_7,
|
|
|
|
|
- guideHome_pla_1,
|
|
|
|
|
- guideHome_pla_2,
|
|
|
|
|
- guideHome_pla_3,
|
|
|
|
|
|
|
+ guide1_form_1,
|
|
|
|
|
+ guide1_pla_1,
|
|
|
|
|
+ guide1_form_2,
|
|
|
|
|
+ guide1_pla_2,
|
|
|
|
|
+ guide1_form_3,
|
|
|
|
|
+ guide1_pla_3,
|
|
|
|
|
+ guide1_form_4,
|
|
|
|
|
+ guide1_pla_4,
|
|
|
|
|
+ guide1_form_5,
|
|
|
|
|
+ guide1_pla_5,
|
|
|
next,
|
|
next,
|
|
|
|
|
+ pass,
|
|
|
|
|
+ passTips,
|
|
|
} = useModel("wordsModel");
|
|
} = useModel("wordsModel");
|
|
|
|
|
+ const { showDialog } = useModel("dialogModel");
|
|
|
const [categoryList, changeCategoryList] = React.useState([]);
|
|
const [categoryList, changeCategoryList] = React.useState([]);
|
|
|
const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
|
|
const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
|
|
|
useFocusEffect(
|
|
useFocusEffect(
|
|
@@ -64,16 +67,15 @@ export default function Guide1Screen({ navigation, route }) {
|
|
|
}, [])
|
|
}, [])
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- const [category, changeCategory] = React.useState("");
|
|
|
|
|
- const [address, changeAddress] = React.useState("");
|
|
|
|
|
|
|
+ const [name, changeName] = React.useState("");
|
|
|
|
|
+ const [amount, changeAmount] = React.useState("");
|
|
|
|
|
+ const [discountAmount, changeDiscountAmount] = React.useState("");
|
|
|
|
|
+ const [inventory, changeInventory] = React.useState(0);
|
|
|
const [week, changeWeek] = React.useState("");
|
|
const [week, changeWeek] = React.useState("");
|
|
|
const [startTime, changeStartTime] = React.useState("08:00");
|
|
const [startTime, changeStartTime] = React.useState("08:00");
|
|
|
const [endTime, changeEndTime] = React.useState("22:00");
|
|
const [endTime, changeEndTime] = React.useState("22:00");
|
|
|
- const [qualification, changeQualification] = React.useState("");
|
|
|
|
|
- const [merchantNatureId, changeMerchantNatureId] = React.useState("");
|
|
|
|
|
- const [logo, changeLogo] = React.useState(
|
|
|
|
|
- "https://idingdong.oss-cn-hangzhou.aliyuncs.com/image/2020-05-08-17-49-29YVnqAOHy.jpg"
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ const [introduction, changeIntroduction] = React.useState();
|
|
|
|
|
+ const [img, changeImg] = React.useState();
|
|
|
const timeValue = React.useMemo(() => {
|
|
const timeValue = React.useMemo(() => {
|
|
|
if (week && startTime && endTime) {
|
|
if (week && startTime && endTime) {
|
|
|
return week + " " + startTime + "~" + endTime;
|
|
return week + " " + startTime + "~" + endTime;
|
|
@@ -83,10 +85,32 @@ export default function Guide1Screen({ navigation, route }) {
|
|
|
}, [week, startTime, endTime]);
|
|
}, [week, startTime, endTime]);
|
|
|
|
|
|
|
|
const canNext = React.useMemo(() => {
|
|
const canNext = React.useMemo(() => {
|
|
|
- return true;
|
|
|
|
|
- }, [logo]);
|
|
|
|
|
-
|
|
|
|
|
- const { registerFirst } = useModel("userModel", true);
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ name &&
|
|
|
|
|
+ amount &&
|
|
|
|
|
+ discountAmount &&
|
|
|
|
|
+ inventory &&
|
|
|
|
|
+ week &&
|
|
|
|
|
+ startTime &&
|
|
|
|
|
+ endTime &&
|
|
|
|
|
+ introduction &&
|
|
|
|
|
+ img
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }, [
|
|
|
|
|
+ name,
|
|
|
|
|
+ amount,
|
|
|
|
|
+ discountAmount,
|
|
|
|
|
+ inventory,
|
|
|
|
|
+ week,
|
|
|
|
|
+ startTime,
|
|
|
|
|
+ endTime,
|
|
|
|
|
+ introduction,
|
|
|
|
|
+ img,
|
|
|
|
|
+ ]);
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
@@ -94,32 +118,49 @@ export default function Guide1Screen({ navigation, route }) {
|
|
|
<ScrollPage>
|
|
<ScrollPage>
|
|
|
<Layout style={styles.container}>
|
|
<Layout style={styles.container}>
|
|
|
<Card appearance='headFilled'>
|
|
<Card appearance='headFilled'>
|
|
|
- <Text category='s1'>{guideHome_title1}</Text>
|
|
|
|
|
|
|
+ <Text category='s1'>{guide1_title1}</Text>
|
|
|
<Text category='s1'>{guideHome_title2}</Text>
|
|
<Text category='s1'>{guideHome_title2}</Text>
|
|
|
</Card>
|
|
</Card>
|
|
|
<Card appearance='formFilled'>
|
|
<Card appearance='formFilled'>
|
|
|
- {/* 输入商家名称 */}
|
|
|
|
|
|
|
+ {/* 商品名称 */}
|
|
|
<FormInput
|
|
<FormInput
|
|
|
- label={guideHome_form_1}
|
|
|
|
|
- selectTitle={guideHome_form_1}
|
|
|
|
|
- type='select'
|
|
|
|
|
- value={category}
|
|
|
|
|
- onChange={changeCategory}
|
|
|
|
|
|
|
+ label={guide1_form_1}
|
|
|
|
|
+ placeholder={guide1_pla_1}
|
|
|
|
|
+ value={name}
|
|
|
|
|
+ onChange={changeName}
|
|
|
|
|
+ style={{ paddingVertical: 3 }}
|
|
|
|
|
+ />
|
|
|
|
|
+ {/* 商品价格 */}
|
|
|
|
|
+ <FormInput
|
|
|
|
|
+ label={guide1_form_2}
|
|
|
|
|
+ placeholder={guide1_pla_2}
|
|
|
|
|
+ value={amount}
|
|
|
|
|
+ type='money'
|
|
|
|
|
+ onChange={changeAmount}
|
|
|
textAlign='right'
|
|
textAlign='right'
|
|
|
- selectList={categoryList}
|
|
|
|
|
- style={{ paddingVertical: 5 }}
|
|
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
|
|
+ {/* 优惠价格 */}
|
|
|
<FormInput
|
|
<FormInput
|
|
|
- label={guideHome_form_2}
|
|
|
|
|
- value={address}
|
|
|
|
|
- onChange={changeAddress}
|
|
|
|
|
|
|
+ label={guide1_form_3}
|
|
|
|
|
+ placeholder={guide1_pla_3}
|
|
|
|
|
+ value={discountAmount}
|
|
|
|
|
+ type='money'
|
|
|
|
|
+ onChange={changeDiscountAmount}
|
|
|
textAlign='right'
|
|
textAlign='right'
|
|
|
/>
|
|
/>
|
|
|
|
|
+ {/* 每日供应数量 */}
|
|
|
|
|
+ <FormInput
|
|
|
|
|
+ label={guide1_form_4}
|
|
|
|
|
+ placeholder={guide1_pla_4}
|
|
|
|
|
+ value={inventory}
|
|
|
|
|
+ type='amount'
|
|
|
|
|
+ onChange={changeInventory}
|
|
|
|
|
+ />
|
|
|
|
|
|
|
|
|
|
+ {/* 供应时间 */}
|
|
|
<FormInput
|
|
<FormInput
|
|
|
- label={guideHome_form_4}
|
|
|
|
|
- selectTitle={guideHome_form_4}
|
|
|
|
|
|
|
+ label={guide1_form_5}
|
|
|
type='openTime'
|
|
type='openTime'
|
|
|
value={timeValue}
|
|
value={timeValue}
|
|
|
onChange={(week, startTime, endTime) => {
|
|
onChange={(week, startTime, endTime) => {
|
|
@@ -127,41 +168,28 @@ export default function Guide1Screen({ navigation, route }) {
|
|
|
changeStartTime(startTime);
|
|
changeStartTime(startTime);
|
|
|
changeEndTime(endTime);
|
|
changeEndTime(endTime);
|
|
|
}}
|
|
}}
|
|
|
- textAlign='right'
|
|
|
|
|
- style={{ paddingVertical: 5 }}
|
|
|
|
|
- />
|
|
|
|
|
-
|
|
|
|
|
- <FormInput
|
|
|
|
|
- label={guideHome_form_5}
|
|
|
|
|
- sub={guideHome_pla_2}
|
|
|
|
|
- type='url'
|
|
|
|
|
- value={qualification ? "已上传" : " "}
|
|
|
|
|
- textAlign='right'
|
|
|
|
|
- style={{ paddingVertical: 5 }}
|
|
|
|
|
- changePath={() => {
|
|
|
|
|
- pushRouter("Qualification");
|
|
|
|
|
- }}
|
|
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
- <FormInput
|
|
|
|
|
- label={guideHome_form_6}
|
|
|
|
|
- sub={guideHome_pla_3}
|
|
|
|
|
- selectTitle={guideHome_form_6}
|
|
|
|
|
- type='select'
|
|
|
|
|
- value={merchantNatureId}
|
|
|
|
|
- textAlign='right'
|
|
|
|
|
- style={{ paddingVertical: 5 }}
|
|
|
|
|
- onChange={changeMerchantNatureId}
|
|
|
|
|
- selectList={merchantNatureList}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <Layout>
|
|
|
|
|
+ <Textarea
|
|
|
|
|
+ containerStyle={styles.textareaContainer}
|
|
|
|
|
+ style={styles.textarea}
|
|
|
|
|
+ onChangeText={changeIntroduction}
|
|
|
|
|
+ defaultValue={introduction}
|
|
|
|
|
+ maxLength={50}
|
|
|
|
|
+ placeholder={guide1_pla_5}
|
|
|
|
|
+ placeholderTextColor={"#B4B4B4"}
|
|
|
|
|
+ underlineColorAndroid={"transparent"}
|
|
|
|
|
+ />
|
|
|
|
|
+ </Layout>
|
|
|
|
|
|
|
|
<FormInput
|
|
<FormInput
|
|
|
- label={guideHome_form_7}
|
|
|
|
|
type='img'
|
|
type='img'
|
|
|
- value={logo}
|
|
|
|
|
|
|
+ value={img}
|
|
|
textAlign='right'
|
|
textAlign='right'
|
|
|
- onChange={changeLogo}
|
|
|
|
|
|
|
+ onChange={changeImg}
|
|
|
/>
|
|
/>
|
|
|
|
|
+
|
|
|
<Layout style={styles.layoutLeft} level='1'>
|
|
<Layout style={styles.layoutLeft} level='1'>
|
|
|
<Button
|
|
<Button
|
|
|
status='primary'
|
|
status='primary'
|
|
@@ -175,12 +203,28 @@ export default function Guide1Screen({ navigation, route }) {
|
|
|
endTime,
|
|
endTime,
|
|
|
qualification,
|
|
qualification,
|
|
|
merchantNatureId,
|
|
merchantNatureId,
|
|
|
- logo,
|
|
|
|
|
|
|
+ img,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
>
|
|
>
|
|
|
{next}
|
|
{next}
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <Button
|
|
|
|
|
+ style={{ marginTop: 10 }}
|
|
|
|
|
+ appearance='ghost'
|
|
|
|
|
+ status='primary'
|
|
|
|
|
+ onPress={() => {
|
|
|
|
|
+ showDialog({
|
|
|
|
|
+ bodyText: passTips,
|
|
|
|
|
+ cancelable: true,
|
|
|
|
|
+ confirmCallback: () => {
|
|
|
|
|
+ changeGuideStep(1, "Guide2");
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {pass}
|
|
|
|
|
+ </Button>
|
|
|
</Layout>
|
|
</Layout>
|
|
|
</Card>
|
|
</Card>
|
|
|
<ConnectButton />
|
|
<ConnectButton />
|
|
@@ -199,12 +243,12 @@ const styles = StyleSheet.create({
|
|
|
backgroundColor: "#fff",
|
|
backgroundColor: "#fff",
|
|
|
marginTop: 20,
|
|
marginTop: 20,
|
|
|
},
|
|
},
|
|
|
- logo: {
|
|
|
|
|
|
|
+ img: {
|
|
|
width: 100,
|
|
width: 100,
|
|
|
height: 100,
|
|
height: 100,
|
|
|
alignSelf: "center",
|
|
alignSelf: "center",
|
|
|
},
|
|
},
|
|
|
- logo2: {
|
|
|
|
|
|
|
+ img2: {
|
|
|
width: 97,
|
|
width: 97,
|
|
|
height: 21,
|
|
height: 21,
|
|
|
alignSelf: "center",
|
|
alignSelf: "center",
|
|
@@ -214,12 +258,26 @@ const styles = StyleSheet.create({
|
|
|
marginTop: 16,
|
|
marginTop: 16,
|
|
|
},
|
|
},
|
|
|
layoutLeft: {
|
|
layoutLeft: {
|
|
|
- flexDirection: "row",
|
|
|
|
|
|
|
+ // flexDirection: "row",
|
|
|
paddingVertical: 10,
|
|
paddingVertical: 10,
|
|
|
justifyContent: "center",
|
|
justifyContent: "center",
|
|
|
|
|
+ alignItems: "center",
|
|
|
},
|
|
},
|
|
|
form: {
|
|
form: {
|
|
|
paddingHorizontal: 26,
|
|
paddingHorizontal: 26,
|
|
|
paddingVertical: 20,
|
|
paddingVertical: 20,
|
|
|
},
|
|
},
|
|
|
|
|
+ textareaContainer: {
|
|
|
|
|
+ backgroundColor: "#F0F0F0",
|
|
|
|
|
+ height: 100,
|
|
|
|
|
+ borderRadius: 4,
|
|
|
|
|
+ },
|
|
|
|
|
+ textarea: {
|
|
|
|
|
+ textAlignVertical: "top", // hack android
|
|
|
|
|
+ fontSize: 13,
|
|
|
|
|
+ color: "#333",
|
|
|
|
|
+ paddingHorizontal: 14,
|
|
|
|
|
+ paddingVertical: 10,
|
|
|
|
|
+ height: 100,
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|