Commit 78c1e13726153e6aab2b3e4fdc496d6cc9d576df

Authored by Adam
1 parent 7614465095
Exists in master

auto commit the code by alias command

package-lock.json
... ... @@ -3491,9 +3491,9 @@
3491 3491 }
3492 3492 },
3493 3493 "caniuse-lite": {
3494   - "version": "1.0.30001048",
3495   - "resolved": "https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001048.tgz?cache=0&sync_timestamp=1587836069414&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001048.tgz",
3496   - "integrity": "sha1-S7TxvC6zBOXhFU2oC5Pe4/HPRH4="
  3494 + "version": "1.0.30001393",
  3495 + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001393.tgz",
  3496 + "integrity": "sha512-N/od11RX+Gsk+1qY/jbPa0R6zJupEa0lxeBG598EbrtblxVCTJsQwbRBm6+V+rxpc5lHKdsXb9RY83cZIPLseA=="
3497 3497 },
3498 3498 "case-sensitive-paths-webpack-plugin": {
3499 3499 "version": "2.3.0",
... ... @@ -6639,8 +6639,7 @@
6639 6639 },
6640 6640 "ansi-regex": {
6641 6641 "version": "2.1.1",
6642   - "bundled": true,
6643   - "optional": true
  6642 + "bundled": true
6644 6643 },
6645 6644 "aproba": {
6646 6645 "version": "1.2.0",
... ... @@ -6658,13 +6657,11 @@
6658 6657 },
6659 6658 "balanced-match": {
6660 6659 "version": "1.0.0",
6661   - "bundled": true,
6662   - "optional": true
  6660 + "bundled": true
6663 6661 },
6664 6662 "brace-expansion": {
6665 6663 "version": "1.1.11",
6666 6664 "bundled": true,
6667   - "optional": true,
6668 6665 "requires": {
6669 6666 "balanced-match": "^1.0.0",
6670 6667 "concat-map": "0.0.1"
... ... @@ -6677,18 +6674,15 @@
6677 6674 },
6678 6675 "code-point-at": {
6679 6676 "version": "1.1.0",
6680   - "bundled": true,
6681   - "optional": true
  6677 + "bundled": true
6682 6678 },
6683 6679 "concat-map": {
6684 6680 "version": "0.0.1",
6685   - "bundled": true,
6686   - "optional": true
  6681 + "bundled": true
6687 6682 },
6688 6683 "console-control-strings": {
6689 6684 "version": "1.1.0",
6690   - "bundled": true,
6691   - "optional": true
  6685 + "bundled": true
6692 6686 },
6693 6687 "core-util-is": {
6694 6688 "version": "1.0.2",
... ... @@ -6791,8 +6785,7 @@
6791 6785 },
6792 6786 "inherits": {
6793 6787 "version": "2.0.4",
6794   - "bundled": true,
6795   - "optional": true
  6788 + "bundled": true
6796 6789 },
6797 6790 "ini": {
6798 6791 "version": "1.3.5",
... ... @@ -6802,7 +6795,6 @@
6802 6795 "is-fullwidth-code-point": {
6803 6796 "version": "1.0.0",
6804 6797 "bundled": true,
6805   - "optional": true,
6806 6798 "requires": {
6807 6799 "number-is-nan": "^1.0.0"
6808 6800 }
... ... @@ -6815,20 +6807,17 @@
6815 6807 "minimatch": {
6816 6808 "version": "3.0.4",
6817 6809 "bundled": true,
6818   - "optional": true,
6819 6810 "requires": {
6820 6811 "brace-expansion": "^1.1.7"
6821 6812 }
6822 6813 },
6823 6814 "minimist": {
6824 6815 "version": "1.2.5",
6825   - "bundled": true,
6826   - "optional": true
  6816 + "bundled": true
6827 6817 },
6828 6818 "minipass": {
6829 6819 "version": "2.9.0",
6830 6820 "bundled": true,
6831   - "optional": true,
6832 6821 "requires": {
6833 6822 "safe-buffer": "^5.1.2",
6834 6823 "yallist": "^3.0.0"
... ... @@ -6845,7 +6834,6 @@
6845 6834 "mkdirp": {
6846 6835 "version": "0.5.3",
6847 6836 "bundled": true,
6848   - "optional": true,
6849 6837 "requires": {
6850 6838 "minimist": "^1.2.5"
6851 6839 }
... ... @@ -6901,8 +6889,7 @@
6901 6889 },
6902 6890 "npm-normalize-package-bin": {
6903 6891 "version": "1.0.1",
6904   - "bundled": true,
6905   - "optional": true
  6892 + "bundled": true
6906 6893 },
6907 6894 "npm-packlist": {
6908 6895 "version": "1.4.8",
... ... @@ -6927,8 +6914,7 @@
6927 6914 },
6928 6915 "number-is-nan": {
6929 6916 "version": "1.0.1",
6930   - "bundled": true,
6931   - "optional": true
  6917 + "bundled": true
6932 6918 },
6933 6919 "object-assign": {
6934 6920 "version": "4.1.1",
... ... @@ -6938,7 +6924,6 @@
6938 6924 "once": {
6939 6925 "version": "1.4.0",
6940 6926 "bundled": true,
6941   - "optional": true,
6942 6927 "requires": {
6943 6928 "wrappy": "1"
6944 6929 }
... ... @@ -7007,8 +6992,7 @@
7007 6992 },
7008 6993 "safe-buffer": {
7009 6994 "version": "5.1.2",
7010   - "bundled": true,
7011   - "optional": true
  6995 + "bundled": true
7012 6996 },
7013 6997 "safer-buffer": {
7014 6998 "version": "2.1.2",
... ... @@ -7038,7 +7022,6 @@
7038 7022 "string-width": {
7039 7023 "version": "1.0.2",
7040 7024 "bundled": true,
7041   - "optional": true,
7042 7025 "requires": {
7043 7026 "code-point-at": "^1.0.0",
7044 7027 "is-fullwidth-code-point": "^1.0.0",
... ... @@ -7056,7 +7039,6 @@
7056 7039 "strip-ansi": {
7057 7040 "version": "3.0.1",
7058 7041 "bundled": true,
7059   - "optional": true,
7060 7042 "requires": {
7061 7043 "ansi-regex": "^2.0.0"
7062 7044 }
... ... @@ -7095,13 +7077,11 @@
7095 7077 },
7096 7078 "wrappy": {
7097 7079 "version": "1.0.2",
7098   - "bundled": true,
7099   - "optional": true
  7080 + "bundled": true
7100 7081 },
7101 7082 "yallist": {
7102 7083 "version": "3.1.1",
7103   - "bundled": true,
7104   - "optional": true
  7084 + "bundled": true
7105 7085 }
7106 7086 }
7107 7087 },
... ...
... ... @@ -91,4 +91,4 @@
91 91 "uni-app": {
92 92 "scripts": {}
93 93 }
94   -}
95 94 \ No newline at end of file
  95 +}
... ...
src/components/CommodityCard/CommodityCard.vue
1 1 <template>
2 2 <view
3 3 class="card"
4   - @tap="toGoods(goods.id?goods.id:goods.pid,goods.sk_id)"
  4 + @tap="toGoods(goods.shop_wood_id?goods.shop_wood_id:goods.shop_wood_id,goods.eyegArr[0].wsp_id)"
5 5 >
6 6 <easy-loadimage
7 7 mode="widthFix"
8 8 :scroll-top="scrollTop"
9   - :image-src="goods.imgurl?goods.imgurl:goods.pic"
  9 + :image-src="goods.url0?goods.url0:goods.url45"
10 10 :viewHeight="viewHeight"
11 11 ></easy-loadimage>
12   - <!-- <image
  12 + <!-- <image
13 13 mode="widthFix"
14   - :src="goods.imgurl?goods.imgurl:goods.pic"
  14 + :src="goods.url0?goods.url0:goods.url45"
15 15 ></image> -->
16   - <view class="name">{{goods.name?goods.name:goods.p_name}}</view>
  16 + <view class="name">{{goods.shop_wood_name?goods.shop_wood_name:goods.shop_wood_name}}</view>
17 17 <view class="info">
18 18 <view class="priceBox">
19   - <view class="price">{{goods.old_price ? goods.old_price : (goods.rsSon && goods.rsSon.Min_Price)}}</view>
  19 + <view class="price">{{goods.sales_price ? goods.sales_price : (goods.sales_price && goods.rsSon.sales_price)}}</view>
20 20 <view class="originCost">
21 21 <!-- {{goods.price !== undefined?goods.price:goods.real_price}} -->
22   - {{goods.real_price ? goods.real_price : parseInt(goods.rsSon && goods.rsSon.Min_Price*(1 + Number(goods.rsSon.discount)/100))}}
  22 + {{goods.sales_price ? goods.sales_price : parseInt(goods.sales_price && goods.sales_price*(1 + Number(0)/100))}}
23 23 </view>
24 24 </view>
25   - <view class="trade_num">{{goods.trade_num}}人购买</view>
  25 + <view class="trade_num">{{goods.sales_num}}人购买</view>
26 26 </view>
27 27 </view>
28 28 </template>
... ... @@ -37,14 +37,16 @@ export default {
37 37 * 商品数据
38 38 */
39 39 goods: {
40   - id: Number,
41   - imgurl: String,
42   - name: String,
43   - rsSon: Object,
44   - originCost: String,
45   - price: String,
46   - trade_num: String,
47   - goodType: String,
  40 + shop_wood_id: Number,
  41 + url0: String,
  42 + url45: String,
  43 + shop_wood_name: String,
  44 + // rsSon: Object,
  45 + // originCost: String,
  46 + sales_price: String,
  47 + sales_num: String,
  48 + // goodType: String,
  49 + eyegArr:Object
48 50 },
49 51 scrollTop: Number,
50 52 viewHeight: Number,
... ... @@ -58,10 +60,10 @@ export default {
58 60 },
59 61  
60 62 methods: {
61   - toGoods (id, skId) {
62   - console.log('---', '../details/details?pid=' + id + '&sk_id=' + skId)
  63 + toGoods (shop_wood_id, skuId) {
  64 + console.log('---', '../details/details?shop_wood_id=' + shop_wood_id + '&sk_id=' + skuId)
63 65 uni.navigateTo({
64   - url: '../details/details?pid=' + id + '&sk_id=' + skId,
  66 + url: '../details/details?shop_wood_id=' + shop_wood_id + '&sk_id=' + skuId,
65 67 success: res => {},
66 68 fail: () => {},
67 69 complete: () => {},
... ...
src/components/UniDrawer/UniDrawer.vue
... ... @@ -57,7 +57,8 @@
57 57 visibleSync: false,
58 58 showDrawer: false,
59 59 rightMode: false,
60   - watchTimer: null,
  60 + watchTimer: null,
  61 + mask:false,
61 62 drawerWidth: 220
62 63 }
63 64 },
... ...
src/pages/details/details.vue
... ... @@ -120,9 +120,9 @@
120 120 <!-- 标签 -->
121 121 <view class="evaluate_tag">
122 122 <view
123   - v-for="(item, index) in evaluate.tag"
  123 + v-for="(item, index) in evaluate.tag.Colour"
124 124 :key="index"
125   - >{{item.name}}</view>
  125 + >{{item}}</view>
126 126 </view>
127 127 </view>
128 128 </template>
... ... @@ -217,8 +217,8 @@ export default {
217 217 },
218 218 data () {
219 219 return {
220   - pid: 7, // 产品ID
221   - skId: undefined, // skuId
  220 + shop_wood_id: 751, // 产品ID
  221 + skId: 2723, // skuId
222 222 // 详细信息菜单
223 223 item_current: 0,
224 224 screenItems: [
... ... @@ -226,18 +226,19 @@ export default {
226 226 '规格参数',
227 227 '售后保障',
228 228 ],
  229 + current:0,
229 230 showPostImg: false, // 是否展示分享海报
230 231 isShowBottom: false, // 是否展示参数选择
231 232 isCart: 1, // 参数选择 按钮判断
232 233 }
233 234 },
234   - onLoad({ pid = this.pid, sk_id: skId }) {
  235 + onLoad({ shop_wood_id = this.shop_wood_id, sk_id: skId }) {
235 236 // 根据页面传参请求页面数据
236   - this.pid = pid
  237 + this.shop_wood_id = shop_wood_id
237 238 this.skId = skId
238 239  
239 240 // 获取产品详情
240   - this.getDetails({ pid, skId })
  241 + this.getDetails({ shop_wood_id, skId })
241 242 // 获取购物车数据
242 243 this.getCartNum()
243 244 },
... ... @@ -285,13 +286,13 @@ export default {
285 286 },
286 287 methods: {
287 288 // 获取产品详情
288   - getDetails({ pid, skId }) {
  289 + getDetails({ shop_wood_id, skId }) {
289 290 store.dispatch('details/details', {
290   - pid,
  291 + shop_wood_id:shop_wood_id,
291 292 sk_id: skId,
292 293 })
293 294 store.dispatch('read/fetch', {
294   - pid,
  295 + shop_wood_id:shop_wood_id,
295 296 sk_id: skId,
296 297 })
297 298 },
... ... @@ -301,9 +302,11 @@ export default {
301 302 },
302 303 // 切换详细信息菜单
303 304 tabChange (e) {
304   - if (this.current !== e) {
  305 + console.error('eeeeeee', e);
  306 + // if (this.current !== e) {
  307 + this.current = e
305 308 this.item_current = e
306   - }
  309 + // }
307 310 },
308 311 // 打开分享界面
309 312 confirmShare() {
... ...
src/pages/index/index.vue
... ... @@ -15,7 +15,7 @@
15 15 <input
16 16 v-model="searchText"
17 17 class="searchIpt"
18   - placeholder="老花镜"
  18 + placeholder="青春镜架"
19 19 confirm-type="search"
20 20 @blur="searchKey"
21 21 />
... ... @@ -61,7 +61,7 @@
61 61 </view>
62 62 </view> -->
63 63 </view>
64   - <Uni-drawer
  64 + <!-- <Uni-drawer
65 65 ref="showRight"
66 66 mask="true"
67 67 maskClick="true"
... ... @@ -74,7 +74,7 @@
74 74 <text class="word-btn-white">关闭</text>
75 75 </view>
76 76 </view>
77   - </Uni-drawer>
  77 + </Uni-drawer> -->
78 78  
79 79 <!-- 筛选菜单-->
80 80 <view class="content-wrap skeleton-rect">
... ... @@ -99,7 +99,7 @@
99 99 <view
100 100 class="product skeleton-rect"
101 101 v-for="(goods) in goodsList"
102   - :key="goods.id"
  102 + :key="goods.shop_wood_id"
103 103 >
104 104 <Card
105 105 :goods="goods"
... ...
src/store/modules/details.js
... ... @@ -62,6 +62,7 @@ const mutations = {
62 62 state.evaluate = evaluate
63 63 state.more = more
64 64 state.skuList = skuList
  65 + // state.current = 1
65 66 },
66 67 CART: (state, number) => {
67 68 state.cartNumber = number
... ... @@ -74,19 +75,24 @@ const mutations = {
74 75 const actions = {
75 76 // 获取详情
76 77 details({ commit, rootState }, param) {
  78 + // console.log('paramparamparamparamparam', param);
77 79 return new Promise((resolve, reject) => request({
78 80 url: read,
79 81 data: param,
80 82 success: ({ data: { data } }) => {
81   - console.log('data.tag', data.tag)
  83 + // console.log('details.details.details.details.details.data.tag', data)
  84 + console.log('this.statethis.statethis.statethis.state', this.state)
  85 + // return;
82 86 // 规格参数设置
83   - const specification = rootState.details.specification
  87 + const specification=[];
  88 + // specification[0].slength=1;
84 89 const parameter = {
  90 + frame_weight: data.frame_weight,
85 91 frame_width: data.frame_width,
86   - glass_width: data.glass_width,
87 92 glass_height: data.glass_height,
88   - nose_width: data.nose_width,
89   - leg_long: data.leg_long,
  93 + nose_width: data.nose_bridge,
  94 + lens_width:data.lens_width,
  95 + leg_long: data.leg_temple,
90 96 weight: data.weight,
91 97 }
92 98 for (let index = 0; index < specification.length; index++) {
... ... @@ -99,23 +105,33 @@ const actions = {
99 105  
100 106 commit('INIT', {
101 107 goodInfo: data,
102   - skuList: data.skuList,
103   - carousel: data.pics,
  108 + skuList: data.sku,
  109 + carousel: data.sku[0].sku_pic_arr_http,
104 110 goodsInfo: {
105   - name: data.p_name,
106   - price: data.priceArea.Min_Price,
107   - discountPrice: data.priceArea.Min_Price - Number(data.priceArea.discount),
108   - tradeNumber: data.trade_num,
  111 + name: data.shop_wood_name,
  112 + price: data.sales_price,
  113 + discountPrice: data.sales_price - Number(0),
  114 + tradeNumber: data.sales_num,
109 115 },
110   - tag: data.tag,
111   - specification,
  116 + tag: data.tag_defined,
  117 + specification:[
  118 + { key: 'frame_width', img: '/static/img/detail/d2.png', standard: '框架宽', slength: '139mm' },
  119 + { key: 'glass_width', img: '/static/img/detail/d3.png', standard: '镜片宽', slength: '51mm' },
  120 + { key: 'glass_height', img: '/static/img/detail/d4.png', standard: '镜片高', slength: '45mm' },
  121 + { key: 'nose_width', img: '/static/img/detail/d5.png', standard: '鼻架宽', slength: '19mm' },
  122 + { key: 'leg_long', img: '/static/img/detail/d6.png', standard: '框架耳长', slength: '138mm' },
  123 + { key: 'weight', img: '/static/img/detail/d7.png', standard: '框架重', slength: '19克(grams)' },
  124 + ],
112 125 evaluate: {
113   - rate: data.judgeInfo.good,
114   - tag: data.judge_tag,
115   - star: parseInt(5 * Number(data.judgeInfo.good.slice(0, -1)) / 100),
  126 + rate: 5,
  127 + tag: data.judge.list,
  128 + // star: parseInt(5 * Number(data.judgeInfo.good.slice(0, -1)) / 100),
  129 + star: 5,
116 130 },
117 131 // eslint-disable-next-line
118   - more: data.prodIntro1.replace(/\<img/gi, '<img style="max-width:100%;height:auto"'),
  132 + // more: data.prodIntro1.replace(/\<img/gi, '<img style="max-width:100%;height:auto"'),
  133 + more: data.shop_wood_desc_rich_text,
  134 + // current:1
119 135 })
120 136 resolve(data)
121 137 },
... ...
src/store/modules/index.js
... ... @@ -382,7 +382,8 @@ let categoryList = [
382 382 return new Promise((resolve) => request({
383 383 url: category,
384 384 success: (res) => {
385   - let data = res.data.data;
  385 + //分类的镜架
  386 + let data = res.data.data.list;
386 387 for (let i = 0; i <= data.length; i++) {
387 388 if (data[i] && data[i].type !== 'filter') {
388 389 data[i].type = 'hierarchy';
... ... @@ -409,7 +410,8 @@ let categoryList = [
409 410 return new Promise((resolve) => request({
410 411 url: shopList,
411 412 success: (res) => {
412   - commit('LIST', res.data.data)
  413 + console.log('shopListshopListshopListshopListshopListshopListshopListshopListshopListshopListshopListshopList',res.data.data.list);
  414 + commit('LIST', res.data.data.list)
413 415 resolve(res.data)
414 416 },
415 417 fail: (res) => {
... ...
src/store/modules/read.js
... ... @@ -24,15 +24,15 @@ const actions = {
24 24 url: read,
25 25 data: param,
26 26 success: (res) => {
27   - console.log('readParm====>', arg)
28   - console.log('read====>', res.data.data)
  27 + // console.log('readParm====>', arg)
  28 + // console.log('read====>', res.data.data)
29 29 // 用一个新的对象来接收sk_id找的值
30 30 const Res = Object.assign({}, res.data.data)
31 31 if (arg.sk_id !== undefined) {
32   - for (let i = 0; i < res.data.data.skuList.length; i++) {
33   - if (res.data.data.skuList[i].sk_id === arg.sk_id) {
34   - Res.p_sale_price = res.data.data.skuList[i].real_price
35   - console.log('陈工了')
  32 + for (let i = 0; i < res.data.data.sku.length; i++) {
  33 + if (res.data.data.sku[i].sk_id === arg.sk_id) {
  34 + Res.p_sale_price = res.data.data.sku[i].real_price
  35 + console.log('.......购物车和用户推荐的价格.........')
36 36 }
37 37 }
38 38 }
... ...
src/store/request.js
1 1 const DOMAIN = 'https://api.glass.xiuyetang.com'
2   -
  2 +// const DOMAIN = 'http://localhost:8062'
3 3 export default async function request({
4 4 url,
5 5 method = 'post',
6   - data = {},
  6 + data = {
  7 + wood_cate: 818,
  8 + shop_id:12
  9 + },
7 10 header = {
8 11 'Content-Type': 'application/x-www-form-urlencoded',
  12 + // 'Appid': 6
9 13 },
10 14 timeout = 3000,
11 15 withCredentials = false, // 跨域请求时是否携带凭证(cookies)
... ...
1 1 const urlAlias = {
2 2 // 详情
3   - read: '/app/prod/read', // 获取商品信息
  3 + read: '/api/frontend/wood/detail', // 获取商品信息
4 4  
5 5 // 首页
6   - shopList: '/app/prod/list', // 获取首页商品列表
7   - category: '/app/prod/category2', // 获取首页商品分类
  6 + shopList: '/api/frontend/wood/list', // 获取首页商品列表
  7 + // category: '/app/prod/category2',
  8 + category: '/api/frontend/wood/category',// 获取首页商品分类
8 9 search: '/app/prod/search', // 首页搜索商品
9 10  
10 11 // 登陆
... ... @@ -23,10 +24,10 @@ const urlAlias = {
23 24 pay: '/app/pay/log', // 支付接口
24 25  
25 26 // 购物车
26   - cartList: '/app/cart/list', // 获取购物车列表
27   - cartModi: '/app/cart/modi', // 修改购物车
28   - cartDel: '/app/cart/del', // 删除购物车
29   - cartAdd: '/app/cart/add', // 添加购物车
  27 + cartList: '/api/frontend/cart/list', // 获取购物车列表
  28 + cartModi: '/api/frontend/cart/modi', // 修改购物车
  29 + cartDel: '/api/frontend/cart/del', // 删除购物车
  30 + cartAdd: '/api/frontend/cart/add', // 添加购物车
30 31  
31 32 // 我的
32 33 recommandList: '/app/prod/recommand', // 获取用户个性化推荐商品
... ...