Selaa lähdekoodia

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

viczhq 3 viikkoa sitten
vanhempi
commit
b0d4b6b29d

+ 14 - 0
project.private.config.json

@@ -10,6 +10,20 @@
10 10
     "miniprogram": {
11 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 27
           "name": "pages/member/index",
14 28
           "pathName": "pages/member/index",
15 29
           "query": "",

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

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

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

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

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

@@ -321,6 +321,13 @@ export default class Index extends Component {
321 321
             <Text className="tag-text">无忧售后</Text>
322 322
           </View>
323 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 332
         <View className="guess-you-like">
326 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 146
     .guess-you-like {
132 147
         display: flex;

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

@@ -6,7 +6,6 @@ import { login, getUserInfo, bindShareJump } from "../../service";
6 6
 import { objToParam } from "../../common/toParams";
7 7
 import "./index.less";
8 8
 import logo1 from "../../images/logo1.png";
9
-import loginBg from "../../images/loginBg.png";
10 9
 export default class Index extends Component {
11 10
   state = {
12 11
     isChecked: false,
@@ -137,7 +136,7 @@ export default class Index extends Component {
137 136
             授权登录
138 137
           </Button>
139 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 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 11
 import warning from "../../images/member/warning.png";
12 12
 import withdrawable from "../../images/member/withdrawable.png";
13 13
 import order from "../../images/member/order.png";
14
-import avatar from "../../images/mine/avatar.png";
15 14
 import partner from "../../images/member/myPartner.png";
16 15
 import calculator from "../../images/member/calculator.png";
17 16
 import InstructionModal from "../../components/instructionModal";
18 17
 export default class Index extends Component {
19 18
   state = {
20 19
     vipInfo: {
21
-      users: { name: "去登录", icon: avatar },
20
+      users: { name: "去登录", icon: 'https://yushi.tos-cn-beijing.volces.com/mine/avatar.png' },
22 21
       earnings: { store_earnings_now: 0, store_earnings_all: 0 },
23 22
       draw_money: { store_earnings_now: 0 },
24 23
       partner: { partner_direct_cnt: 0 },

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

@@ -7,7 +7,6 @@ import "./index.less";
7 7
 import loginOut from "../../images/mine/loginOut.png";
8 8
 import edit from "../../images/mine/edit.png";
9 9
 import norm from "../../images/mine/norm.png";
10
-import avatar from "../../images/mine/avatar.png";
11 10
 import sign from "../../images/mine/sign.png";
12 11
 import SignModal from "../../components/signModal";
13 12
 import levelOne from "../../images/mine/levelOne.png";
@@ -91,7 +90,7 @@ export default class Index extends Component {
91 90
         {/* 个人信息 */}
92 91
         <View className="info">
93 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 94
             className="avatar"
96 95
           />
97 96
           <View className="info-right">

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

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

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

@@ -55,4 +55,13 @@
55 55
         justify-content: center;
56 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
 }