Browse Source

增加商品描述&&更换本地图片

viczhq 3 weeks ago
parent
commit
b0d4b6b29d

+ 14 - 0
project.private.config.json

@@ -10,6 +10,20 @@
10
     "miniprogram": {
10
     "miniprogram": {
11
       "list": [
11
       "list": [
12
         {
12
         {
13
+          "name": "pages/indexSub/productDetail/index",
14
+          "pathName": "pages/indexSub/productDetail/index",
15
+          "query": "id=21268&isSeckill=false&shareUserId=&tagTitle=&isShare=false",
16
+          "launchMode": "default",
17
+          "scene": null
18
+        },
19
+        {
20
+          "name": "pages/mineSub/infoEdit/index",
21
+          "pathName": "pages/mineSub/infoEdit/index",
22
+          "query": "",
23
+          "launchMode": "default",
24
+          "scene": null
25
+        },
26
+        {
13
           "name": "pages/member/index",
27
           "name": "pages/member/index",
14
           "pathName": "pages/member/index",
28
           "pathName": "pages/member/index",
15
           "query": "",
29
           "query": "",

+ 4 - 7
src/components/Modal/index.jsx

@@ -5,9 +5,6 @@ import { formatDate } from "../../common/time";
5
 import { isDebounce } from "../../common/debounce";
5
 import { isDebounce } from "../../common/debounce";
6
 import "./index.less";
6
 import "./index.less";
7
 import Taro from "@tarojs/taro";
7
 import Taro from "@tarojs/taro";
8
-import selectStep from "../../images/productDetail/selectStep.png";
9
-import xianyu from "../../images/productDetail/xianyu.png";
10
-import stepThree from "../../images/productDetail/stepThree.png";
11
 export default function Modal(props) {
8
 export default function Modal(props) {
12
   const { productPromotion, isOpened, title, linkText, id, shareUserId,isSeckill } =
9
   const { productPromotion, isOpened, title, linkText, id, shareUserId,isSeckill } =
13
     props;
10
     props;
@@ -58,7 +55,7 @@ export default function Modal(props) {
58
                 </View>
55
                 </View>
59
                 <View className="step-box">
56
                 <View className="step-box">
60
                   <View className="step-One">复制口令</View>
57
                   <View className="step-One">复制口令</View>
61
-                  <Image className="step-img-one" src={selectStep} />
58
+                  <Image className="step-img-one" src='https://yushi.tos-cn-beijing.volces.com/productDetail/selectStep.png'/>
62
                 </View>
59
                 </View>
63
               </View>
60
               </View>
64
               <View className="step-item">
61
               <View className="step-item">
@@ -67,8 +64,8 @@ export default function Modal(props) {
67
                   <Text className="desc">打开闲鱼APP</Text>
64
                   <Text className="desc">打开闲鱼APP</Text>
68
                 </View>
65
                 </View>
69
                 <View className="step-box">
66
                 <View className="step-box">
70
-                  <Image className="step-img-t" src={xianyu} />
71
-                  <Image className="step-img-two" src={selectStep} />
67
+                  <Image className="step-img-t" src='https://yushi.tos-cn-beijing.volces.com/productDetail/xianyu.png' />
68
+                  <Image className="step-img-two" src='https://yushi.tos-cn-beijing.volces.com/productDetail/selectStep.png' />
72
                 </View>
69
                 </View>
73
               </View>
70
               </View>
74
               <View className="step-item">
71
               <View className="step-item">
@@ -80,7 +77,7 @@ export default function Modal(props) {
80
                   <Image
77
                   <Image
81
                     mode="heightFix"
78
                     mode="heightFix"
82
                     className="step-img-three"
79
                     className="step-img-three"
83
-                    src={stepThree}
80
+                    src='https://yushi.tos-cn-beijing.volces.com/productDetail/stepThree.png'
84
                   />
81
                   />
85
                 </View>
82
                 </View>
86
               </View>
83
               </View>

BIN
src/images/loginBg.png


BIN
src/images/mine/avatar.png


BIN
src/images/productDetail/selectStep.png


BIN
src/images/productDetail/stepThree.png


BIN
src/images/productDetail/xianyu.png


BIN
src/images/seckill/heighTop.jpg


BIN
src/images/seckill/seckillTop.jpg


+ 7 - 1
src/pages/index/index.jsx

@@ -79,7 +79,13 @@ export default class Index extends Component {
79
     );
79
     );
80
   }
80
   }
81
   componentDidShow() {
81
   componentDidShow() {
82
-    this.getHomeData(); //获取首页数据
82
+    this.setState({
83
+      page: 1,
84
+      totalPages: 1,
85
+      loading: false,
86
+    }, () => {
87
+      this.getHomeData(); //获取首页数据
88
+    });
83
   }
89
   }
84
   // 添加回到顶部方法
90
   // 添加回到顶部方法
85
   handleBackTop = () => {
91
   handleBackTop = () => {

+ 1 - 2
src/pages/indexSub/highCommission/index.jsx

@@ -2,7 +2,6 @@ import { Component } from "react";
2
 import { View, Image } from "@tarojs/components";
2
 import { View, Image } from "@tarojs/components";
3
 import "./index.less";
3
 import "./index.less";
4
 import Taro from "@tarojs/taro";
4
 import Taro from "@tarojs/taro";
5
-import seckillImg from "../../../images/seckill/heighTop.jpg";
6
 import ProductList from "../../../components/index/ProductList";
5
 import ProductList from "../../../components/index/ProductList";
7
 import { getRecommendProductList, addLog } from "../../../service";
6
 import { getRecommendProductList, addLog } from "../../../service";
8
 import { getShareContent } from "../../../common/share";
7
 import { getShareContent } from "../../../common/share";
@@ -121,7 +120,7 @@ export default class Index extends Component {
121
   render() {
120
   render() {
122
     return (
121
     return (
123
       <View className="index">
122
       <View className="index">
124
-        <Image className="seckill" src={seckillImg} mode="aspectFill" />
123
+        {/* <Image className="seckill" src={seckillImg} mode="aspectFill" /> */}
125
         {/* 商品列表 */}
124
         {/* 商品列表 */}
126
         <View className="product-list">
125
         <View className="product-list">
127
           <ProductList
126
           <ProductList

+ 7 - 0
src/pages/indexSub/productDetail/index.jsx

@@ -321,6 +321,13 @@ export default class Index extends Component {
321
             <Text className="tag-text">无忧售后</Text>
321
             <Text className="tag-text">无忧售后</Text>
322
           </View>
322
           </View>
323
         </View>
323
         </View>
324
+        {/* 产品详情 */}
325
+        <View className="product-detail">
326
+          <View className="title">商品描述</View>
327
+          {productDetail.item_desc && (
328
+            <Text className="content">{productDetail.item_desc}</Text>
329
+          )}
330
+        </View>
324
         {/* 猜你喜欢 */}
331
         {/* 猜你喜欢 */}
325
         <View className="guess-you-like">
332
         <View className="guess-you-like">
326
           <Image src={like} mode="aspectFit" />
333
           <Image src={like} mode="aspectFit" />

+ 16 - 1
src/pages/indexSub/productDetail/index.less

@@ -126,7 +126,22 @@
126
             }
126
             }
127
         }
127
         }
128
     }
128
     }
129
-
129
+    // 产品详情
130
+    .product-detail {
131
+        margin: 20px 16px 0 16px;
132
+        padding: 22px 17px;
133
+        box-sizing: border-box;
134
+        background-color: #fff;
135
+        border-radius: 20px;
136
+        .title {
137
+            font-size: 32px;
138
+            line-height: 40px;
139
+            color: #000000;
140
+            font-weight: 700;
141
+            text-align: center;
142
+            width: 100%;
143
+        }
144
+    }
130
     //   猜你喜欢
145
     //   猜你喜欢
131
     .guess-you-like {
146
     .guess-you-like {
132
         display: flex;
147
         display: flex;

+ 1 - 2
src/pages/login/index.jsx

@@ -6,7 +6,6 @@ import { login, getUserInfo, bindShareJump } from "../../service";
6
 import { objToParam } from "../../common/toParams";
6
 import { objToParam } from "../../common/toParams";
7
 import "./index.less";
7
 import "./index.less";
8
 import logo1 from "../../images/logo1.png";
8
 import logo1 from "../../images/logo1.png";
9
-import loginBg from "../../images/loginBg.png";
10
 export default class Index extends Component {
9
 export default class Index extends Component {
11
   state = {
10
   state = {
12
     isChecked: false,
11
     isChecked: false,
@@ -137,7 +136,7 @@ export default class Index extends Component {
137
             授权登录
136
             授权登录
138
           </Button>
137
           </Button>
139
         </View>
138
         </View>
140
-        <Image src={loginBg} className="login-bg" />
139
+        <Image src='https://yushi.tos-cn-beijing.volces.com/login/loginBg.png' className="login-bg" />
141
       </View>
140
       </View>
142
     );
141
     );
143
   }
142
   }

+ 1 - 2
src/pages/member/index.jsx

@@ -11,14 +11,13 @@ import toDetail from "../../images/member/toDetail.png";
11
 import warning from "../../images/member/warning.png";
11
 import warning from "../../images/member/warning.png";
12
 import withdrawable from "../../images/member/withdrawable.png";
12
 import withdrawable from "../../images/member/withdrawable.png";
13
 import order from "../../images/member/order.png";
13
 import order from "../../images/member/order.png";
14
-import avatar from "../../images/mine/avatar.png";
15
 import partner from "../../images/member/myPartner.png";
14
 import partner from "../../images/member/myPartner.png";
16
 import calculator from "../../images/member/calculator.png";
15
 import calculator from "../../images/member/calculator.png";
17
 import InstructionModal from "../../components/instructionModal";
16
 import InstructionModal from "../../components/instructionModal";
18
 export default class Index extends Component {
17
 export default class Index extends Component {
19
   state = {
18
   state = {
20
     vipInfo: {
19
     vipInfo: {
21
-      users: { name: "去登录", icon: avatar },
20
+      users: { name: "去登录", icon: 'https://yushi.tos-cn-beijing.volces.com/mine/avatar.png' },
22
       earnings: { store_earnings_now: 0, store_earnings_all: 0 },
21
       earnings: { store_earnings_now: 0, store_earnings_all: 0 },
23
       draw_money: { store_earnings_now: 0 },
22
       draw_money: { store_earnings_now: 0 },
24
       partner: { partner_direct_cnt: 0 },
23
       partner: { partner_direct_cnt: 0 },

+ 1 - 2
src/pages/mine/index.jsx

@@ -7,7 +7,6 @@ import "./index.less";
7
 import loginOut from "../../images/mine/loginOut.png";
7
 import loginOut from "../../images/mine/loginOut.png";
8
 import edit from "../../images/mine/edit.png";
8
 import edit from "../../images/mine/edit.png";
9
 import norm from "../../images/mine/norm.png";
9
 import norm from "../../images/mine/norm.png";
10
-import avatar from "../../images/mine/avatar.png";
11
 import sign from "../../images/mine/sign.png";
10
 import sign from "../../images/mine/sign.png";
12
 import SignModal from "../../components/signModal";
11
 import SignModal from "../../components/signModal";
13
 import levelOne from "../../images/mine/levelOne.png";
12
 import levelOne from "../../images/mine/levelOne.png";
@@ -91,7 +90,7 @@ export default class Index extends Component {
91
         {/* 个人信息 */}
90
         {/* 个人信息 */}
92
         <View className="info">
91
         <View className="info">
93
           <Image
92
           <Image
94
-            src={userInfo.icon ? userInfo.icon : avatar}
93
+            src={userInfo.icon ? userInfo.icon : 'https://yushi.tos-cn-beijing.volces.com/mine/avatar.png'}
95
             className="avatar"
94
             className="avatar"
96
           />
95
           />
97
           <View className="info-right">
96
           <View className="info-right">

+ 29 - 18
src/pages/mineSub/infoEdit/index.jsx

@@ -1,9 +1,8 @@
1
 import { Component } from "react";
1
 import { Component } from "react";
2
-import { View, Text, Image,Input, Button } from "@tarojs/components";
2
+import { View, Text, Image, Input, Button } from "@tarojs/components";
3
 import { AtInput } from "taro-ui";
3
 import { AtInput } from "taro-ui";
4
 import Taro from "@tarojs/taro";
4
 import Taro from "@tarojs/taro";
5
-import { updateUserInfo,getUserInfo } from "../../../service";
6
-import avatar from "../../../images/mine/avatar.png";
5
+import { updateUserInfo, getUserInfo } from "../../../service";
7
 import "./index.less";
6
 import "./index.less";
8
 
7
 
9
 export default class Index extends Component {
8
 export default class Index extends Component {
@@ -34,11 +33,11 @@ export default class Index extends Component {
34
     return value;
33
     return value;
35
   }
34
   }
36
   // 昵称
35
   // 昵称
37
-  handleNickNameChange(value) {
36
+  handleNickNameChange(res) {
38
     this.setState({
37
     this.setState({
39
-      nickName: value,
38
+      nickName: res.detail.value,
40
     });
39
     });
41
-    return value;
40
+    return res.detail.value;
42
   }
41
   }
43
   // 手机号
42
   // 手机号
44
   handlePhoneChange(value) {
43
   handlePhoneChange(value) {
@@ -52,7 +51,7 @@ export default class Index extends Component {
52
     this.setState({
51
     this.setState({
53
       avatar: e.detail.avatarUrl,
52
       avatar: e.detail.avatarUrl,
54
     });
53
     });
55
-  }
54
+  };
56
   // 提交
55
   // 提交
57
   handleSubmit = async () => {
56
   handleSubmit = async () => {
58
     const phoneRegex = /^1[3-9]\d{9}$/; // 中国大陆手机号正则
57
     const phoneRegex = /^1[3-9]\d{9}$/; // 中国大陆手机号正则
@@ -76,15 +75,15 @@ export default class Index extends Component {
76
       wechat_account: this.state.wxAccount,
75
       wechat_account: this.state.wxAccount,
77
     });
76
     });
78
     Taro.showToast({
77
     Taro.showToast({
79
-      title: '修改成功',
80
-      icon: 'none',
78
+      title: "修改成功",
79
+      icon: "none",
81
       duration: 1000, // 显示持续时间,单位毫秒
80
       duration: 1000, // 显示持续时间,单位毫秒
82
       success: () => {
81
       success: () => {
83
         // 等待 toast 显示完成后再返回上一页
82
         // 等待 toast 显示完成后再返回上一页
84
         setTimeout(() => {
83
         setTimeout(() => {
85
           Taro.navigateBack();
84
           Taro.navigateBack();
86
         }, 1000);
85
         }, 1000);
87
-      }
86
+      },
88
     });
87
     });
89
   };
88
   };
90
   render() {
89
   render() {
@@ -92,11 +91,14 @@ export default class Index extends Component {
92
       <View className="index">
91
       <View className="index">
93
         {/* 头像 */}
92
         {/* 头像 */}
94
         <View className="info-edit">
93
         <View className="info-edit">
95
-          <Image
96
-            src={this.state.avatar||avatar}
97
-            className="info-edit-img"
98
-          />
99
-          {/* <Button onChooseAvatar={this.handleChooseAvatar} open-type="chooseAvatar" className="info-edit-title">更换头像</Button> */}
94
+          <Image src={this.state.avatar || 'https://yushi.tos-cn-beijing.volces.com/mine/avatar.png'} className="info-edit-img" />
95
+          {/* <Button
96
+            onChooseAvatar={this.handleChooseAvatar}
97
+            open-type="chooseAvatar"
98
+            className="info-edit-title"
99
+          >
100
+            更换头像
101
+          </Button> */}
100
         </View>
102
         </View>
101
         {/* 内容 */}
103
         {/* 内容 */}
102
         <View className="info-edit-content">
104
         <View className="info-edit-content">
@@ -109,19 +111,28 @@ export default class Index extends Component {
109
             onChange={this.handleAccountChange.bind(this)}
111
             onChange={this.handleAccountChange.bind(this)}
110
           /> */}
112
           /> */}
111
           <AtInput
113
           <AtInput
114
+            className="info-edit-input"
112
             name="value"
115
             name="value"
113
             title="鱼市昵称"
116
             title="鱼市昵称"
114
             type="text"
117
             type="text"
115
             placeholder="请输入鱼市昵称"
118
             placeholder="请输入鱼市昵称"
116
-            value={this.state.nickName}
117
-            onChange={this.handleNickNameChange.bind(this)}
118
-          />
119
+          >
120
+            <Input
121
+              name="value"
122
+              title="鱼市昵称"
123
+              type="nickname"
124
+              placeholder="请输入鱼市昵称"
125
+              value={this.state.nickName}
126
+              onInput={this.handleNickNameChange.bind(this)}
127
+            />
128
+          </AtInput>
119
           <AtInput
129
           <AtInput
120
             border={false}
130
             border={false}
121
             name="value"
131
             name="value"
122
             title="手机号"
132
             title="手机号"
123
             type="number"
133
             type="number"
124
             placeholder="请输入手机号"
134
             placeholder="请输入手机号"
135
+            placeholderStyle="color: #828282;"
125
             value={this.state.phone}
136
             value={this.state.phone}
126
             onChange={this.handlePhoneChange.bind(this)}
137
             onChange={this.handlePhoneChange.bind(this)}
127
           />
138
           />

+ 9 - 0
src/pages/mineSub/infoEdit/index.less

@@ -55,4 +55,13 @@
55
         justify-content: center;
55
         justify-content: center;
56
         align-items: center;
56
         align-items: center;
57
     }
57
     }
58
+    // 隐藏输入框
59
+    .info-edit-input{
60
+        .at-input__input{
61
+            display: none;
62
+        }
63
+        .at-input__children::after{
64
+            border-left-width: 0;
65
+        }
66
+    }
58
 }
67
 }