Browse Source

Signed-off-by: liuboyan <632697560@qq.com>
登录

liuboyan 4 years ago
parent
commit
1a47b6da9d
3 changed files with 55 additions and 32 deletions
  1. 14 12
      config/api.js
  2. 15 3
      pages/index/index.vue
  3. 26 17
      pagesGood/goodDetails.vue

+ 14 - 12
config/api.js

@@ -1,30 +1,32 @@
-const WX_API_BASE = 'https://hubw.jihengcc.cn'
+const WX_API_BASE = 'https://hubw.jihengcc.cn/'
 
 
 module.exports = {
 module.exports = {
 	//  微信登录
 	//  微信登录
 	WxLogin: WX_API_BASE + 'app/auth/user/wx/login',
 	WxLogin: WX_API_BASE + 'app/auth/user/wx/login',
 	//  获取广告
 	//  获取广告
-	getAdvert: WX_API_BASE + '/app/product/user/homePage',
+	getAdvert: WX_API_BASE + 'app/product/user/homePage',
 	//  获取今日特惠商品列表
 	//  获取今日特惠商品列表
-	getPreferentialGoods: WX_API_BASE + '/app/product/user/homePage/indulgenceProductList',
+	getPreferentialGoods: WX_API_BASE + 'app/product/user/homePage/indulgenceProductList',
 	//  获取猜你喜欢商品列表
 	//  获取猜你喜欢商品列表
-	getPreferGoods: WX_API_BASE + '/app/product/user/homePage/guessLike/getProductList',
+	getPreferGoods: WX_API_BASE + 'app/product/user/homePage/guessLike/getProductList',
 	//  获取直播列表
 	//  获取直播列表
-	getLiveTelecast: WX_API_BASE + '/app/liveAndVideo/user/homePage/liveList',
+	getLiveTelecast: WX_API_BASE + 'app/liveAndVideo/user/homePage/liveList',
 	//  获取短视频列表
 	//  获取短视频列表
-	getShortVideo: WX_API_BASE + '/app/liveAndVideo/user/homePage/videoList',
+	getShortVideo: WX_API_BASE + 'app/liveAndVideo/user/homePage/videoList',
 	
 	
 	//  获取分类
 	//  获取分类
-	getSortList: WX_API_BASE + '/app/productCategory/categoryInitialization',
+	getSortList: WX_API_BASE + 'app/productCategory/categoryInitialization',
 	//  获取分类下商品
 	//  获取分类下商品
-	getGoodsBySort: WX_API_BASE + '/app/productCategory/selectProductCategory',
+	getGoodsBySort: WX_API_BASE + 'app/productCategory/selectProductCategory',
 	//  获取自助采摘、共享种植、拍卖商品列表
 	//  获取自助采摘、共享种植、拍卖商品列表
-	getGoodsByType: WX_API_BASE + '/app/product/homeCategoryProductPage',
+	getGoodsByType: WX_API_BASE + 'app/product/homeCategoryProductPage',
 	//  获取商品详情
 	//  获取商品详情
-	getCommonGoodDetail: WX_API_BASE + '/app/product/user/productDetail',
+	getCommonGoodDetail: WX_API_BASE + 'app/product/user/productDetail',
+	//  获取商品评价
+	getAssessList: WX_API_BASE + 'app/product/user/productDetail/evaluateList',
 	
 	
 	//  添加购物车
 	//  添加购物车
-	addCart: WX_API_BASE + '/app/shoppingcart/user/addCart',
+	addCart: WX_API_BASE + 'app/shoppingcart/user/addCart',
 	//  下订单
 	//  下订单
-	submitOrder: WX_API_BASE + '/app/order/user/submitOrder',
+	submitOrder: WX_API_BASE + 'app/order/user/submitOrder',
 }
 }

+ 15 - 3
pages/index/index.vue

@@ -97,7 +97,6 @@
 			}
 			}
 		},
 		},
 		onLoad() {
 		onLoad() {
-			// this.appLoginWx()
 			NET.request(API.getAdvert, {}, 'GET').then(res => {
 			NET.request(API.getAdvert, {}, 'GET').then(res => {
 				if (res.code == 0) {
 				if (res.code == 0) {
 					this.advertList = res.data
 					this.advertList = res.data
@@ -138,6 +137,7 @@
 					});
 					});
 				}
 				}
 			})
 			})
+			this.appLoginWx()
 			setTimeout(() => {
 			setTimeout(() => {
 				this.triggered = true;
 				this.triggered = true;
 			}, 1000)
 			}, 1000)
@@ -162,10 +162,22 @@
 												rawData: info.rawData,
 												rawData: info.rawData,
 												signature: info.signature,
 												signature: info.signature,
 											}, 'POST').then(res3 => {
 											}, 'POST').then(res3 => {
-												if (res.code == 0) {
+												if (res3.code == 0) {
 													uni.setStorage({
 													uni.setStorage({
 														key: 'token',
 														key: 'token',
-														data: res3.data.token
+														// data: res3.data.token
+														data: "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiTEJZIiwidG9rZW5fdHlwZSI6InRva2VuIiwidXNlcmlkIjoiMTMxNDc2OTM4MjQ5NjI3MjM4NCIsImFjY291bnQiOiJvQm56ODRoR3g3QTh2VVBqakNLWEJnQUhLb29nIiwiZXhwIjoxNjAyNTgzNTcyLCJuYmYiOjE2MDI1NTQ3NzJ9.zXIQjHNtfT1WIpWQnOAMJZAVO_v8b00RZCZvQ5IhrvU"
+													});
+													uni.setStorage({
+														key: 'userData',
+														data: {
+															// headImage: info.userInfo.avatarUrl,
+															// userName: res3.data.name,
+															// userId: res3.data.userId,
+															headImage: "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKNAiaKzpyq7FfCCf6JSDP4zYRvKbkB4dibHic8JOBYiaTCXNKqZAicQnVwxMZDPv2nRbPicc56IqwFeGicA/132",
+															userName: "LBY",
+															userId: "1314769382496272384",
+														}
 													});
 													});
 												}
 												}
 											}).catch(res3 => {
 											}).catch(res3 => {

+ 26 - 17
pagesGood/goodDetails.vue

@@ -28,16 +28,16 @@
 		<rich-text :nodes="goodData.sellDesc" v-if="tabIndex == 1"></rich-text>
 		<rich-text :nodes="goodData.sellDesc" v-if="tabIndex == 1"></rich-text>
 		<view class="good-assess" v-else>
 		<view class="good-assess" v-else>
 			<view class="assess-row" v-for="(item,index) in assessList" :key="index">
 			<view class="assess-row" v-for="(item,index) in assessList" :key="index">
-				<cover-image class="assess-head" :src="item.imgPath"></cover-image>
+				<cover-image class="assess-head" :src="item.headimg"></cover-image>
 				<view class="assess-info">
 				<view class="assess-info">
-					<view class="assess-name">{{item.imgPath}}</view>
-					<view class="assess-date">{{item.imgPath}}</view>
+					<view class="assess-name">{{item.nickname}}</view>
+					<view class="assess-date">{{item.replyTime}}</view>
 					<view class="assess-sore-box">
 					<view class="assess-sore-box">
-						<view class="sore-col" v-for="site in item.grade" :key="site"></view>
+						<view class="sore-col" v-for="site in item.score" :key="site"></view>
 					</view>
 					</view>
-					<view class="assess-text">{{item.imgPath}}</view>
+					<view class="assess-text">{{item.replyContent}}</view>
 					<view class="assess-img-box">
 					<view class="assess-img-box">
-						<cover-image class="img-col" v-for="site in item.imgPath" :key="site" :src="site"></cover-image>
+						<cover-image class="img-col" v-for="site in item.evaluateImgs" :key="site" :src="site.imgUrl"></cover-image>
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
@@ -135,6 +135,16 @@
 						})
 						})
 					}
 					}
 				}).catch(res => {})
 				}).catch(res => {})
+				NET.request(API.getAssessList + '/' + this.goodId + '/1/3', {}, 'GET').then(res => {
+					if (res.code == 0) {
+						this.assessList = res.data.list
+					} else {
+						uni.showToast({
+							title: "获取商品评价失败",
+							icon: "none"
+						})
+					}
+				}).catch(res => {})
 			}
 			}
 		},
 		},
 		methods: {
 		methods: {
@@ -159,18 +169,17 @@
 					uni.setStorage({
 					uni.setStorage({
 						key: 'orderData',
 						key: 'orderData',
 						data: {
 						data: {
-							tenantCode: '',
-							supplierName: '',
+							tenantCode: this.goodData.tenantCode,
+							supplierName: this.goodData.supplierName,
 							goodsList: [{
 							goodsList: [{
-								bizPrice: 0,
-								buyNum: 0,
-								imgUrl: "",
-								originalPrice: 0,
-								productId: 0,
-								productName: "",
-								productType: 0,
-								shoppingcartId: 0,
-								tenantCode: ""
+								bizPrice: this.goodData.bizPrice,
+								buyNum: this.number,
+								imgUrl: this.goodData.imgs.length ? this.goodData.imgs[0].imgPath : '',
+								originalPrice: this.goodData.originalPrice,
+								productId: this.goodId,
+								productName: this.goodData.productName,
+								productType: this.goodData.productType,
+								tenantCode: this.goodData.tenantCode,
 							}]
 							}]
 						}
 						}
 					});
 					});