mr-zhou-zhou 2 年之前
父节点
当前提交
f9a911864e
共有 11 个文件被更改,包括 729 次插入141 次删除
  1. 56 0
      common/request/api.js
  2. 2 2
      common/tools.js
  3. 19 0
      pages.json
  4. 1 1
      pages/mang/components/pro-item.vue
  5. 125 40
      pages/mang/confirm.vue
  6. 122 53
      pages/mang/detail.vue
  7. 106 42
      pages/mang/shops.vue
  8. 9 3
      pages/mine/mine.vue
  9. 198 0
      pages/public/pay.vue
  10. 91 0
      pages/public/paySuc.vue
  11. 二进制
      static/pay-ok.png

+ 56 - 0
common/request/api.js

@@ -88,6 +88,62 @@ export default {
 			method:'POST',
 			isNprogress:true
 		},
+		commentList:{
+			url:'api/user_goods/commentList',
+			auth:false,
+			method:'POST',
+			isNprogress:true
+		},
+		shop:{
+			url:'api/shop/shopInfo',
+			auth:false,
+			method:'POST',
+			isNprogress:true
+		},
+		getInfoText:{
+			url:'api/config/getInfoText',
+			auth:false,
+			method:'POST',
+			isNprogress:false
+		},
+		getPromise:{
+			url:'api/config/getPromise',
+			auth:false,
+			method:'POST',
+			isNprogress:false
+		},
+		shopComments:{
+			url:'api/shop_comment/list',
+			auth:false,
+			method:'POST',
+			isNprogress:false
+		},
+		shopCoupons:{
+			url:'api/coupon/userlist',
+			auth:false,
+			method:'POST',
+			isNprogress:false
+		},
+	},
+	order:{
+		add:{
+			url:'api/order/add',
+			auth:false,
+			method:'POST',
+			isNprogress:false
+		},
+		list:{
+			url:'api/order/orderList',
+			auth:false,
+			method:'POST',
+			isNprogress:false
+		},
+		pay:{
+			url:'api/order/pay',
+			auth:false,
+			method:'POST',
+			isNprogress:true
+		},
 	},
 	favorite:{
 		add:{

+ 2 - 2
common/tools.js

@@ -389,8 +389,8 @@ const handleDate=(date)=>{
 const handleDateTime=(date)=>{
 	let m = handleStrLength(date.getMonth() + 1);
 	let d = handleStrLength(date.getDate());
-	// let h = handleStrLength(date.getHours());
-	// let mm = handleStrLength(date.getMinutes());
+	let h = handleStrLength(date.getHours());
+	let mm = handleStrLength(date.getMinutes());
 	let dateStr = date.getFullYear() + "-" + m + "-" + d + " " + h + ":" + mm;
 	// let dateStr = date.getFullYear() + "-" + m + "-" + d;
 	return dateStr;

+ 19 - 0
pages.json

@@ -252,6 +252,25 @@
 		    }
 		    
 		}
+        ,{
+            "path" : "pages/public/pay",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "支付",
+                "enablePullDownRefresh": false,
+				"navigationBarBackgroundColor": "#f8f8f8"
+            }
+        }
+		,{
+		    "path" : "pages/public/paySuc",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "支付",
+		        "enablePullDownRefresh": false,
+				"navigationBarBackgroundColor": "#f8f8f8"
+		    }
+		    
+		}
     ],
 	"tabBar": {
 		"color": "#999999",

+ 1 - 1
pages/mang/components/pro-item.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="flex-row section_2 view_6"  @tap="navTo('/pages/mang/detail',{id:info.id})">
+	<view class="flex-row section_2 view_6"  @tap="navTo('/pages/mang/detail',{id:info.id},{isCheckLogin:true})">
 	  <image
 		:src="info.goods_img"
 		class="group_11"

+ 125 - 40
pages/mang/confirm.vue

@@ -1,16 +1,18 @@
 <template>
-	<view class="page">
+	<!-- v-if="info.id" -->
+	<view class="page" >
+		
 		<view class="pro-sec flex-row justify-between section_3">
 			<view class="flex-row">
-				<image src="/static/temp/pro.png" class="image_5" mode="aspectFill" />
+				<image :src="info.goods_img" class="image_5" mode="aspectFill" />
 				<view class="flex-col group_7">
 					<view class="flex-col items-start">
-						<text class="text_2 clamp">幸福西饼Rice盲盒</text>
-						<view class="stars align-center"><image src="/static/mang_star.png" class="image_6" v-for="(item, idx) in 3" :key="idx" /></view>
+						<text class="text_2 clamp">{{info.goods_name}}</text>
+						<view class="stars align-center"><image src="/static/mang_star.png" class="image_6" v-for="(item, idx) in info.rank" :key="idx" /></view>
 					</view>
 					<view class="group_9">
 						<text class="text_3">¥</text>
-						<text class="text_4">149.00</text>
+						<text class="text_4">{{info.shop_price}}</text>
 					</view>
 				</view>
 			</view>
@@ -32,10 +34,10 @@
 		<view class="loc-sec flex-col">
 		  <view class="flex-row section_5">
 			<view class="flex-col items-start group_11">
-			  <text class="text_9 clamp">幸福西饼万达店</text>
-			  <text class="text_11 clamp2">长安路与香港路交汇处万达广场3楼1104</text>
+			  <text class="text_9 clamp">{{info.shop_name}}</text>
+			  <text class="text_11 clamp2">{{info.full_address}}</text>
 			</view>
-			<view class="align-center group_12">
+			<view class="align-center group_12" @tap="makePhone">
 			  <view class="section_6"></view>
 			  <image
 				src="/static/confirm-phone.png"
@@ -43,9 +45,19 @@
 			  />
 			</view>
 		  </view>
-		  <view class="flex-row justify-between group_13">
+		  <view class="flex-row justify-between group_13" @tap="navTo('/pages/address/address',{sourcePage:'mang'},{isCheckLogin:true})">
+				<text class="text_12">您的地址</text>
+				<view class="flex-row" >
+				  <text class="text_14 clamp" :class="{active: addrInfo.address}">{{addrInfo.address? addrInfo.address : '请选择'}}</text>
+				  <image
+					src="/static/confirm-rarrow.png"
+					class="image_8"
+				  />
+				</view>
+		  </view>
+		  <view class="flex-row justify-between group_13" @tap="openTime">
 			<text class="text_12">自提时间</text>
-			<view class="flex-row" @tap="openTime">
+			<view class="flex-row" >
 			  <text class="text_14" :class="{active: show_time}">{{show_time? show_time : '请选择'}}</text>
 			  <image
 				src="/static/confirm-rarrow.png"
@@ -57,12 +69,12 @@
 		<view class="price-sec flex-col">
 			  <view class="flex-row justify-between group_15">
 				<text class="text_16">商品总额</text>
-				<text class="text_17">¥149.00</text>
+				<text class="text_17">¥{{total}}</text>
 			  </view>
-			  <view class="flex-row justify-between group_13">
+			  <view class="flex-row justify-between group_13" @tap="showCoupons">
 				<text class="text_12">优惠券</text>
-				<view class="flex-row group_16" @tap="showCoupons">
-				  <text class="text_14">请选择</text>
+				<view class="flex-row group_16" >
+				  <text class="text_14" :class="{active: coupon_price>0}">{{ coupon_price>0 ? `-${coupon_price}`: '请选择'}}</text>
 				  <image
 					src="/static/confirm-rarrow.png"
 					class="image_8"
@@ -73,7 +85,7 @@
 		<view class="note-sec flex-col">
 			  <text class="text_20">订单备注</text>
 			  <view class="flex-col items-start text-wrapper">
-				  <textarea class="area" placeholder="请输入备注信息"></textarea>
+				  <textarea class="area" placeholder="请输入备注信息" v-model="remark"></textarea>
 			  </view>
 		</view>
 	    <safeArea height="128rpx">
@@ -83,10 +95,10 @@
 					    <text class="text_22">待支付</text>
 					    <view class="group_18 align-center">
 					      <text class="text_23">¥</text>
-					      <text class="text_24 clamp">151.00</text>
+					      <text class="text_24 clamp">{{realTotal}}</text>
 					    </view>
 					  </view>
-					  <view class="flex-col items-center text-wrapper_1"><text class="text_25">立即支付</text></view>
+					  <view class="flex-col items-center text-wrapper_1" :class="{disabled: isSubmitted}" @tap="$tools.throttle(submit)"><text class="text_25">立即支付</text></view>
 				</view>
 			</template>
 		</safeArea>
@@ -101,11 +113,14 @@
 				</view>
 				<view class="content-wrap">
 					<scroll-view scroll-y="true" class="scroll">
-						<view class="item flex-col justify-center" v-for="(item,idx) in 10" :key="idx">
-							<view class="name clamp">店铺优惠1</view>
+						<view class="item flex-col justify-center" 
+						  v-for="(item,idx) in couponList" :key="idx"
+						  @tap="tapCoupon(idx)"
+						>
+							<view class="name clamp">{{item.title}}</view>
 							<view class="tips">
 								<text class="stxt">消费金额</text>
-								<text class="mtxt">满30减5</text>
+								<text class="mtxt">{{item.handel_des}}</text>
 							</view>	
 						</view>	
 					</scroll-view>
@@ -125,49 +140,75 @@ export default {
 	},
 	data() {
 		return {
-			stock: 10000,
+			id:'', //盲盒id
+			shopId:'', //店铺id
+			info:{},
+			stock: 1000000,
 			number: 1,
-			show_time:'', //自提时间
+			
 			couponList: [], //优惠券列表
 			useCouponIndex: -1,
 			coupon_price: 0.0, //优惠券金额
-			price: 0.0, //商品金额
-			total: 0.0 ,//实付金额
+			total: 0.0 ,//总额
+			realTotal:0.0,//实付金额
+			
 			startdate: '',
 			enddate: '2042-05-30 23:59',
+			show_time:'', //自提时间
+			
+			address:{},
+			
+			remark:'',
+			pay_type: '', //1=余额支付,2微信支付
 		};
 	},
-	onLoad() {
+	async onLoad(e) {
 		let date = new Date();
-		this.startdate = this.$tools.handleDatetime(date);
+		this.startdate = this.$tools.handleDateTime(date);
+		this.id =e.id;
+		this.shopId = e.shopId;
+		await this.getInfo();
+		this.number = 1;
+		this.stock = this.info.num;
+		this.calcTotal();
 	},
 	methods: {
+		async getInfo(){
+			let sendData={
+				goods_id:this.id,
+				lng: this.addrInfo.address ? this.addrInfo.address_lng : '',
+				lat: this.addrInfo.address ? this.addrInfo.address_lat : '',
+			}
+			let res = await this.$request('goods.info',sendData);
+			this.info = res.data.goods_info;
+		},
 		//数量
 		async numberChange(data) {
-			//number,index
 			this.number = data.number;
 			this.calcTotal();
 		},
+		makePhone(){
+			uni.makePhoneCall({
+				phoneNumber: this.info.shop_mobile
+			})
+		},
 		// 计算价格
 		calcTotal() {
-			let price = 0;
-			let number = 0; // 产品数量
-
-			//计算出当前产品price,number
-			this.price = price.toFixed(2);
-			let total = price;
-
+			let price = parseFloat(this.info.shop_price).toFixed(2);
+			let number = this.number; // 产品数量
+			this.total = price * number;
+			this.realTotal = price * number;
 			// 检查当前优惠券是否满足使用条件
 			this.coupon_price = 0.0;
 			if (this.useCouponIndex != -1 && this.couponList && this.couponList[this.useCouponIndex]) {
-				this.coupon_price = this.couponList[this.useCouponIndex].value;
-				if (this.price >= this.couponList[this.useCouponIndex].least) {
-					total = total - this.coupon_price;
+				this.coupon_price = this.couponList[this.useCouponIndex].money;
+				if (this.total >= this.couponList[this.useCouponIndex].min_money) {
+					this.realTotal = this.total - this.coupon_price;
 				} else {
 					this.$tools.msg('选中的优惠券不满足使用条件', 2000);
 					this.useCouponIndex = -1; //取消选中的优惠券
 					this.coupon_price = 0; //设置优惠金额为0
-					total = total - this.coupon_price;
+					this.realTotal = this.total - this.coupon_price;
 				}
 			}
 		},
@@ -178,13 +219,46 @@ export default {
 	    openTime(){
 	    	this.$refs.timeRef.open();
 	    },
-		showCoupons(){
+		async showCoupons(){
+			let sendData = {
+				shop_id: this.shopId,
+				total_amount: this.total,
+			}
+			let res = await this.$request('goods.shopCoupons',sendData);
+			this.couponList = res.data;
 			this.$refs.couponRef.show();
 		},
 		hideCoupons(){
 			this.$refs.couponRef.hide();
 		},
-		
+		tapCoupon(idx){
+			this.hideCoupons();
+			if(idx === this.useCouponIndex){
+				return;
+			}
+			this.useCouponIndex = idx;
+			this.calcTotal();
+		},
+		async submit(){
+			if(!this.addrInfo.id){
+				this.$tools.msg('请选择您的地址')
+				return;
+			}else if(! this.show_time){
+				this.$tools.msg('请输入自提时间')
+				return;
+			}
+			let sendData={
+				id:this.id,
+				shop_id:this.shopId,
+				buy_number: this.number,
+				self_hours:this.show_time,
+				coupon_id: this.useCouponIndex !== -1 ? this.couponList[this.useCouponIndex].id : '',
+				address_id: this.addrInfo.id,
+				remark: this.remark,
+			}
+			let res=await this.$request('order.add',sendData);
+			this.navTo('/pages/public/pay',{orderId:res.data.id})
+		},
 	}
 };
 </script>
@@ -307,6 +381,10 @@ page {
 	}
 	.group_13 {
 	  padding: 40rpx 0;
+	  border-bottom: 2rpx solid #eee;
+	  &:last-child{
+		  border: none;
+	  }
 	}
 	.text_12 {
 	  color: #333333;
@@ -319,6 +397,7 @@ page {
 	  color: #999999;
 	  font-size: 28rpx;
 	  font-family: PingFang;
+	  max-width: 400rpx;
 	  &.active{
 		  color: #333;
 	  }
@@ -371,6 +450,9 @@ page {
 	  font-size: 28rpx;
 	  font-family: PingFang;
 	  line-height: 26rpx;
+	  &.active{
+		  color: #ff342e;
+	  }
 	}
 	.image_8 {
 	  margin: 4rpx 0 4rpx 11rpx;
@@ -442,6 +524,9 @@ page {
 	  border-radius: 38rpx;
 	  width: 228rpx;
 	  height: 76rpx;
+	  &.disabled{
+		  background-color: #eee;
+	  }
 	}
 	.text_25 {
 	  color: #ffffff;

+ 122 - 53
pages/mang/detail.vue

@@ -1,19 +1,23 @@
 <template>
 	<view class="page">
 		<view class="swiper-sec">
-			<swiper :indicator-dots="true" :autoplay="false" :interval="3000" :duration="1000" class="swiper">
-				<swiper-item v-for="(item, idx) in 3" :key="idx" class="swiper-item">
-					<view class="img-wrap"><image src="/static/temp/pro.png" mode="aspectFill" class="img"></image></view>
+			<swiper :indicator-dots="true" :autoplay="true" :circular="true" :interval="3000" :duration="1000" class="swiper">
+				<swiper-item v-for="(item, idx) in banners" :key="idx" class="swiper-item">
+					<view class="img-wrap"><image :src="item" mode="aspectFill" class="img"></image></view>
 				</swiper-item>
 			</swiper>
-			<view class="ic-wrap align-center justify-center"><image src="/static/love-full.png" mode="aspectFill" class="ic"></image></view>
+			<view class="ic-wrap align-center justify-center" @tap="tapLove">
+				<image src="/static/love-full.png" mode="aspectFill" class="ic" v-if="info.is_fav_shop === 1"></image>
+				<image src="/static/love.png" mode="aspectFill" class="ic" v-else></image>
+			</view>
 		</view>
 		<view class="header-sec">
-			<view class="flex-col name-wrap">
+			<!-- navTo('/pages/mang/shops',{id:this.info.shop_id}) -->
+			<view class="flex-col name-wrap" @tap="goShop">
 				<view class="flex-col">
 					<view class="flex-row">
-						<text class="text_2 clamp">幸福西饼Rice盲盒</text>
-						<view class="text-wrapper text_3 clamp">仅剩3份</view>
+						<text class="text_2 clamp">{{info.goods_name}}</text>
+						<view class="text-wrapper text_3 clamp">仅剩{{info.num}}份</view>
 					</view>
 					<image
 						src="/static/mangd-rarrow.png"
@@ -25,7 +29,7 @@
 						 <image
 						  src="/static/mang_star.png"
 						  class="image_10"
-						  v-for="(item,idx) in 3"
+						  v-for="(item,idx) in info.rank"
 						  :key="idx"
 						/>	
 					</view>
@@ -35,7 +39,7 @@
 			<view class="border-wrap"></view>
 			<view class="flex-row time-wrap">
 				<text class="text_5">自提时间</text>
-				<text class="text_6">今天15:00~22:00</text>
+				<text class="text_6">{{info.self_hours}}</text>
 			</view>
 			<view class="border-wrap"></view>
 			<view class="flex-col loc-wrap">
@@ -47,12 +51,12 @@
 							mode="aspectFill"
 						/>
 						<view class="flex-col items-start group_15">
-							<text class="text_7 clamp">幸福西饼万达店</text>
-							<text class="text_8 clamp2">河东区万达广场1F东门入口</text>
+							<text class="text_7 clamp">{{info.shop_name}}</text>
+							<text class="text_8 clamp2">{{info.full_address}}</text>
 						</view>
 					</view>
 					<view class="flex-row group_16">
-						<view class="flex-col items-center image-wrapper">
+						<view class="flex-col items-center image-wrapper" @tap='goLoc'>
 							<image
 								src="/static/mangd-loc.png"
 								class="image_13"
@@ -60,7 +64,7 @@
 							/>
 						</view>
 						<view class="section_5"><!--*--></view>
-						<view class="flex-col items-center image-wrapper view_3">
+						<view class="flex-col items-center image-wrapper view_3" @tap="makePhone">
 							<image
 								src="/static/mang-phone.png"
 								class="image_14"
@@ -69,22 +73,22 @@
 						</view>
 					</view>
 				</view>
-				<view class="group_17">
+				<view class="group_17" v-if="info.distance">
 					<text class="text_9">距离您</text>
-			 	<text class="text_10">864m</text>
+			 	<text class="text_10">{{info.distance}}</text>
 				</view>
 			</view>
 		</view>
 		<view class="line-wrap"></view>
 		<view class="flex-col items-start tips-wrap">
 			<text class="title">盲盒内能得到什么</text>
-			<text class="text_12">随机获得四拼蛋糕,奶油慕斯蛋糕二选一<br/>精致蛋挞、南瓜蛋糕二选一</text>
+			<text class="text_12">{{info.goods_description}}</text>
 		</view>
 		<view class="line-wrap"></view>
 		<view class="review-sec">
 			<view class="title-wrap align-center justify-between">
 				<text class="text_14">商品评价</text>
-				<view class="flex-row group_21">
+				<view class="flex-row group_21" v-if="loaded && comments.length !==0 ">
 					<text class="text_15">查看全部</text>
 					<image
 						src="/static/mangd-rarrow.png"
@@ -92,25 +96,37 @@
 						mode="aspectFill"
 			 	    />
 				</view>
-			</view>		
-			<evaItem v-for="(item,idx) in 3" :key="idx" />
+			</view>	
+			<view class="review-wrap">
+				<evaItem :info="item" v-for="(item,idx) in comments" :key="idx" />
+				<empty v-if="loaded && comments.length === 0 " marginTop="40rpx"/>		
+			</view>
 		</view>
 		<view class="line-wrap"></view>
 		<view class="rich-wrap">
-			<rich-text :nodes="richTxt" class="rich"></rich-text>
-		</view>
-		<view class="btn-wrap">
-			<view class="flex-row group_34">
-			  <view class="flex-col justify-center items-start section_7">
-			    <view class="group_35 align-center">
-			      <text class="text_26">¥</text>
-			      <text class="text_27 clamp">149.00</text>
-			    </view>
-			  </view>
-			  <view class="flex-col items-center text-wrapper_1"><text class="text_30">下单</text></view>
+			<view class="title">
+				{{tips.title}}
+			</view>
+			<view class="content">
+				{{tips.value}}
 			</view>
 		</view>
-		<safe-area />
+		
+		<safe-area height="94rpx">
+			<template v-slot:btn>
+				<view class="btn-wrap">
+					<view class="flex-row group_34">
+					  <view class="flex-col justify-center items-start section_7">
+						<view class="group_35 align-center">
+						  <text class="text_26">¥</text>
+						  <text class="text_27 clamp">{{info.shop_price}}</text>
+						</view>
+					  </view>
+					  <view class="flex-col items-center text-wrapper_1" @tap="navTo('/pages/mang/confirm',{id:info.id,shopId:info.shop_id},{isCheckLogin:true})"><text class="text_30">下单</text></view>
+					</view>
+				</view>
+			</template>
+		</safe-area>
 	</view>
 </template>
 
@@ -123,40 +139,77 @@ export default {
 	data() {
 		return {
 			info:{},
-			loadingType:'more',
-			page:1,
-			pageSize:20,
-			list:[],
-			richTxt:'<p>你知道吗,盲go good</p>', //	this.richTxt = this.$tools.replaceDetail(this.info.content || '');
+			banners:[],
+			comments:[],
+			loaded:false,
+			sRes:'', //搜索结果 empty,noMore
+			tips:{},
 		};
 	},
 	onLoad(e) {
 		this.id = e.id;
 		this.getInfo();
+		this.getTips();
+		this.getComments();
+		// this.$nextTick(()=>{
+		// 	this.reqData={goods_id:this.id} //请求数据
+		// })
 	},
 	methods:{
 		async getInfo(){
 			let sendData={
-				id:this.id,
-				page: this.page,
-				limit: this.pageSize,
+				goods_id:this.id,
 				lng: this.addrInfo.address ? this.addrInfo.address_lng : '',
 				lat: this.addrInfo.address ? this.addrInfo.address_lat : '',
 			}
 			let res = await this.$request('goods.info',sendData);
-			
+			this.info = res.data.goods_info;
+			this.banners = this.info.rotation_img.split(',');
 		},
-		// async tapLove(type){
-		// 	let url = type === 'add' ? 'favorite.add' : 'favorite.cancel'
-		// 	let sendData={
-		// 		id:this.id,
-		// 	}
-		// 	let res = await this.$request(url,sendData);
+		async getTips(){
+			let res = await this.$request('goods.getInfoText');
+			this.tips = res.data;
+		},
+		async getComments(){
+			let res = await this.$request('goods.commentList',{goods_id:this.id,page:1,limit:5});
+			this.loaded = true;
+			this.comments = res.data.row;
+		},
+		async tapLove(){
+			let url = this.info.is_fav_shop === 1 ? 'favorite.cancel' : 'favorite.add';
+			let sendData={
+				shop_id:this.info.shop_id,
+			}
+			let res = await this.$request(url,sendData);
+			this.$tools.msg(res.msg);
+			this.info.is_fav_shop = this.info.is_fav_shop === 1 ? 0 : 1;
+		},
+		// previewImg(idx){
+		// 	let url = [];
+		// 	this.$tools.previewImg(url)
 		// },
-		previewImg(idx){
-			let url = [];
-			this.$tools.previewImg(url)
-		}
+		searchEnd({loadingType,pageOneRes}){
+			if(loadingType === 'noMore' && pageOneRes && pageOneRes.length === 0){
+				this.sRes='empty';
+			}else{
+				this.sRes=loadingType;
+			}
+		},
+		makePhone(){
+			uni.makePhoneCall({
+				phoneNumber: this.info.shop_mobile
+			})
+		},
+		goLoc(){
+			uni.openLocation({
+				latitude: Number(this.info.shop_lat),
+				longitude:Number(this.info.shop_lng)
+			})
+		},
+		goShop(){
+			this.navTo('/pages/mang/shops',{id:this.info.shop_id})
+		},
+		
 	}
 };
 </script>
@@ -176,7 +229,7 @@ export default {
 				top: 0;
 				width: 100%;
 				height: 100%;
-				background-color: rgba(0,0,0,.4);
+				background: linear-gradient(180deg, rgba(0,0,0,0),rgba(0,0,0,.2));
 			}
 		}
 		.img{
@@ -357,10 +410,14 @@ export default {
 		font-size: 24rpx;
 		font-family: PingFang;
 		line-height: 36rpx;
+	    word-break: break-all;
 	}
 }
 .review-sec{
 	padding-top: 35rpx;
+	.review-wrap{
+		min-height: 340rpx;
+	}
 }
 .title-wrap {
 	height: 37rpx;
@@ -393,8 +450,20 @@ export default {
 
 .rich-wrap{
 	background-color: #fff;
-	.rich {
-		line-height: normal;
+	padding: 30rpx;
+	.title{
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #333333;
+	}
+	.content{
+		margin-top: 20rpx;
+		font-size: 24rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #999999;
+		line-height: 37rpx;
 	}
 }
 .btn-wrap{

+ 106 - 42
pages/mang/shops.vue

@@ -1,80 +1,88 @@
 <template>
-	<view class="page">
+	<view class="page" v-if="info.id">
 		<view class="header-sec"></view>
 		<view class="name-sec flex-col">
-			<image src="/static/temp/pro.png" class="img" mode="aspectFill" />
+			<image :src="info.shop_logo" class="img" mode="aspectFill" />
 			<view class="flex-row group_5">
-				<view class="flex-row group_6">
-					<text class="name clamp">幸福西饼万达店</text>
-					<image src="/static/love.png" class="ic" mode="aspectFill" />
+				<view class="flex-row group_6" @tap="tapLove">
+					<text class="name clamp">{{info.shop_name}}</text>
+					<image src="/static/love-full.png" class="ic" mode="aspectFill" v-if="info.is_fav_shop === 1" />
+					<image src="/static/love.png" class="ic" mode="aspectFill" v-else />
 				</view>
-				<text class="loc-txt">距您518m</text>
+				<text class="loc-txt" v-if="info.distance">距您{{info.distance}}</text>
 			</view>
-			<view class="stars align-center"><image src="/static/mang_star.png" class="starImg" v-for="(item, idx) in 3" :key="idx" /></view>
+			<view class="stars align-center"><image src="/static/mang_star.png" class="starImg" v-for="(item, idx) in info.rank" :key="idx" /></view>
 			<text class="group_5 text_4 clamp2">
-				主营业务介绍内容主营业务介绍内容主营业务介绍内容主营业务介绍内容主营业务介绍内容主营业务介绍内容主营业务介绍内容主营业务介绍内容
+				{{info.shop_desc}}
 			</text>
 			<view class="flex-row group_5 loc-wrap">
 				<view class="flex-row group_7">
 					<image src="/static/mangd-loc.png" class="image_7" mode="aspectFill" />
-					<view class="group_8"><text class="text_5 clamp2">北京市朝阳街区朝阳社区朝阳小区朝阳路万达广场商场内负一楼B1008铺位</text></view>
+					<view class="group_8"><text class="text_5 clamp2">{{info.full_address}}</text></view>
 				</view>
-				<image src="/static/shop-dire.png" class="image_8" />
+				<image src="/static/shops-dire.png" class="image_8" />
 			</view>
 		</view>
 		<view class="pro-sec flex-col">
 			<text class="title">盲盒</text>
 			<view class="flex-col">
-				<view class="flex-row items-start list-item" :key="i" v-for="(item, i) in 6">
-					<image src="/static/temp/pro.png" class="image" mode="aspectFill" />
+				<view class="flex-row items-start list-item" :key="i" v-for="(item, i) in info.goods">
+					<image :src="item.goods_img_text" class="image" mode="aspectFill" />
 					<view class="flex-col group_10">
 						<view class="flex-col items-start group_11 view_7">
-							<text class="name clamp">幸福西饼Rice盲盒</text>
-							<view class="stars align-center"><image src="/static/mang_star.png" class="starImg" v-for="(item, idx) in 3" :key="idx" /></view>
+							<text class="name clamp">{{item.goods_name}}</text>
+							<view class="stars align-center"><image src="/static/mang_star.png" class="starImg" v-for="(star, idx) in item.rank" :key="idx" /></view>
 							<text class="text_10">随机搭配</text>
 						</view>
 						<view class="flex-row group_12">
 							<view class="group_13">
 								<text class="text_11">¥</text>
-								<text class="text_12">18.8</text>
+								<text class="text_12">{{item.shop_price}}</text>
 							</view>
-							<text class="text_13">¥24~33</text>
+							<text class="text_13">¥{{item.market_price}}</text>
 						</view>
 					</view>
-					<view class="flex-col items-center btn-wrap"><text class="txt">立即下单</text></view>
+					<view class="flex-col items-center btn-wrap" @tap="navTo('/pages/mang/confirm',{id:item.id,shopId:info.id},{isCheckLogin:true})">
+						<text class="txt">立即下单</text>
+					</view>
 				</view>
 			</view>
 		</view>
 		<view class="tab-sec flex-col">
 			<view class="flex-row tab-wrap">
-				<text class="tab active">用户评价</text>
-				<text class="tab">商家故事</text>
+				<text class="tab" :class="{active: curTabIdx === 0}" @tap="tapTab(0)">用户评价</text>
+				<text class="tab" :class="{active: curTabIdx === 1}" @tap="tapTab(1)">商家故事</text>
 			</view>
 		</view>
-		<view class="eva-sec" v-if="false">
+		<view class="eva-sec" v-if="curTabIdx === 0">
 			<view class="e-top justify-between">
-				<view class="flex-row">
-					<view class="flex-row group_21">
-						<text class="text_23">4.5分</text>
+				<view class="flex-row e-top-wrap">
+					<view class="justify-center group_21">
+						<text class="text_23">{{info.score}}分</text>
 						<view class="flex-col items-start group_22">
 							<text class="text_24">总评分</text>
 							<view class="stars align-center"><image src="/static/mang_star.png" class="starImg" v-for="(item, idx) in 5" :key="idx" /></view>
 						</view>
-						<view class="section_8"></view>
+						<!-- <view class="section_8"></view> -->
 					</view>
 					<view class="flex-col items-center group_23">
 						<text class="text_25">评价</text>
-						<text class="text_26">70条</text>
+						<text class="text_26">{{info.score_num}}条</text>
 					</view>
 					<view class="section_8"></view>
 					<view class="flex-col group_24">
 						<text class="text_27">好评率</text>
-						<text class="text_28">85%</text>
+						<text class="text_28">{{info.score_rate}}</text>
 					</view>
 				</view>
 			</view>
 			<view class="division-wrap"></view>
-			<evaItem v-for="(item,idx) in 6" :key="idx" />
+			<singleList ref="listRef" url="goods.shopComments" :sendData="reqData" @reqEnd="searchEnd">
+				<template v-slot:items="{list}">
+					<evaItem :info="item" v-for="(item,idx) in list" :key="idx" />
+					<!-- <empty v-if="sRes && sRes==='empty'"/> -->
+				</template>
+			</singleList>
 		</view>
 		<view class="story-sec" v-else>
 			<view class="s-top">
@@ -82,25 +90,20 @@
 					<text class="key">
 						商家名称:
 					</text>
-					<text class="val">幸福西饼</text>
+					<text class="val">{{info.shop_name}}</text>
 				</view>
 				<view class="line-wrap flex-row">
 					<text class="key">
 						商家地址:
 					</text>
-					<text class="val">万达广场商场内负一楼</text>
+					<text class="val">{{info.full_address}}</text>
 				</view>	
 			</view>
 			<view class="division-wrap"></view>
-			<!-- 
-			<view class="rich-wrap">
-				<rich-text :nodes="richTxt" class="rich"></rich-text>
-			</view>
-			 -->
 			<view class="promise-wrap">
-				<view class="name">商家承诺:</view>
+				<view class="name">{{promise.title}}</view>
 				<view class="content">
-					本店所售盲盒保证品质完好,请放心购买!感谢您为粮食节约助力!一起实现零浪费、环保绿色的低碳生活。
+					{{promise.value}}
 				</view>
 			</view>
 		</view>
@@ -116,8 +119,62 @@ export default {
 	},
 	data() {
 		return {
-			richTxt:'<p>你知道吗,盲go good</p>', //	this.richTxt = this.$tools.replaceDetail(this.info.content || '');
+			id:'', //店铺id
+			info:{},
+			curTabIdx:0,
+			promise:{},
+			comments:[],
+			reqData:{}, //请求数据
+			sRes:'', //搜索结果 empty,noMore
 		};
+	},
+	onReachBottom() {
+		this.$refs.listRef.getList();
+	},
+	onLoad(e) {
+		this.id = e.id;
+		this.getInfo();
+		this.getPromise();
+		this.$nextTick(()=>{
+			this.reqData={shop_id:this.id} //请求数据
+		})
+	},
+	methods:{
+		async getInfo(){
+			let sendData={
+				shop_id:this.id,
+				lng: this.addrInfo.address ? this.addrInfo.address_lng : '',
+				lat: this.addrInfo.address ? this.addrInfo.address_lat : '',
+			}
+			let res = await this.$request('goods.shop',sendData);
+			this.info = res.data;
+		},
+		async tapLove(){
+			let url = this.info.is_fav_shop === 1 ? 'favorite.cancel' : 'favorite.add';
+			let sendData={
+				shop_id:this.id,
+			}
+			let res = await this.$request(url,sendData);
+			this.$tools.msg(res.msg);
+			this.info.is_fav_shop = this.info.is_fav_shop === 1 ? 0 : 1;
+		},
+		tapTab(idx){
+			if(idx === this.curTabIdx){
+				return;
+			}
+			this.curTabIdx = idx;
+		},
+		async getPromise(){
+			let res = await this.$request('goods.getPromise');
+			this.promise = res.data;
+		},
+		searchEnd({loadingType,pageOneRes}){
+			if(loadingType === 'noMore' && pageOneRes && pageOneRes.length === 0){
+				this.sRes='empty';
+			}else{
+				this.sRes=loadingType;
+			}
+		},
 	}
 };
 </script>
@@ -191,6 +248,7 @@ page{
 		font-size: 24rpx;
 		font-family: PingFang;
 		line-height: 32rpx;
+		word-wrap: break-word;
 	}
 	.loc-wrap {
 		margin-top: 18rpx;
@@ -372,7 +430,9 @@ page{
 		padding: 17rpx 3rpx 19rpx;
 		.group_21 {
 			margin: 5rpx 0 8rpx;
-			padding: 0 30rpx;
+			// padding: 0 30rpx;
+			flex:1;
+			border-right: 2rpx solid #eee;
 		}
 		.text_23 {
 			align-self: center;
@@ -400,11 +460,12 @@ page{
 
 		.section_8 {
 			background-color: #0000000f;
-			width: 1rpx;
+			width: 2rpx;
 			height: 70rpx;
 		}
 		.group_23 {
 			margin: 4rpx 0 8rpx;
+			width: 200rpx;
 		}
 		.text_25 {
 			color: #999999;
@@ -418,11 +479,11 @@ page{
 			font-family: PingFang;
 		}
 		.group_24 {
-			margin: 4rpx 30rpx 10rpx 0;
-			width: 98rpx;
+			margin: 4rpx 0 10rpx 0;
+			width: 200rpx;
 		}
 		.text_27 {
-			align-self: flex-start;
+			align-self: center;
 			color: #999999;
 			font-size: 24rpx;
 			font-family: PingFang;
@@ -435,6 +496,9 @@ page{
 			font-family: PingFang;
 		}
 	}
+    .e-top-wrap{
+		width: 100%;
+	}
 }
 .story-sec{
 	padding-top: 30rpx;

+ 9 - 3
pages/mine/mine.vue

@@ -2,6 +2,7 @@
 	<view class="page">
 		<navbarLine :hasPlacer="false" bgColor="transparent"><view class="pageTitle">我的</view></navbarLine>
 		<view class="p-header flex-col">
+			<image src="/static/mine-bg.png" mode="aspectFill" class="bg"></image>
 			<view class="flex-col section_1">
 				<!-- -->
 				<view class="flex-row group_2">
@@ -113,11 +114,16 @@ page {
 .p-header {
 	padding-bottom: 40rpx;
 	height: 518rpx;
+	position: relative;
+	.bg{
+		width: 750rpx;
+		height: 518rpx;
+		position: absolute;
+		z-index: -1;
+	}
 	.section_1 {
 		padding: 76rpx 43rpx 151rpx;
-		background-image: url('/static/mine-bg.png');
-		background-size: 100% 100%;
-		background-repeat: no-repeat;
+		// background: url(/static/mine-bg.png) no-repeat center/cover;
 	}
 	.group_2 {
 		margin-top: 48rpx;

+ 198 - 0
pages/public/pay.vue

@@ -0,0 +1,198 @@
+<template>
+	<view class="page">
+		<view class="p-top flex-col align-center justify-center">
+			<view class="key">待支付金额</view>
+			<view class="price">¥151.00</view>
+		</view>
+		<view class="p-type">
+			<view class="line align-center" @tap="tapType(1)">
+				<view class="key">
+					余额支付
+				</view>
+				<text class="money">{{userInfo.money}}</text>
+				<image :src="payType === 1? '/static/check-do.png' : '/static/check-un.png'" mode="widthFix" class="ic"></image>
+			</view>
+			<view class="line align-center" @tap="tapType(2)">
+				<view class="key">
+					微信支付
+				</view>
+				<image :src="payType === 2? '/static/check-do.png' : '/static/check-un.png'" mode="widthFix" class="ic"></image>
+			</view>
+		</view>
+		<submit-btn @submit="submit" ref="submitRef">
+			<template v-slot:btns="{isSubmitted}">
+				<view class="p-btn" :class="{'disabled':isSubmitted}">
+                   立即支付
+				</view>
+			</template>
+		</submit-btn>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				openid:'',
+				orderId:'',
+				payType:'', //1=余额支付,2微信支付
+				price:0,
+			};
+		},
+		onLoad(e){
+			this.orderId = e.orderId;
+			this.getOpenid();
+		},
+		methods:{
+			async getOpenid(){
+				let [lErr,lRes] = await uni.login({
+					provider: 'weixin'
+				});
+				if (lRes.hasOwnProperty('code')) {
+				    let res = await this.$request('user.getopenid',{code:lRes.code});
+					this.openid = res.data.openid;
+				}else {
+					this.$tools.msg('登录失败,请重启应用');
+				}
+			},
+			tapType(type){
+				if(type === this.payType){
+					return;
+				}
+				if(type===1 &&   parseFloat(this.price || 0)  > parseFloat(this.userInfo.money || 0) ){
+					this.$tools.msg('您的余额不足')
+					return;
+				}
+				this.payType = type;
+			},
+			//支付
+			async submit(){
+				if(!this.openid){
+					let [mErr,mRes] = await uni.showModal({
+						title: '微信错误,请刷新',
+					    showCancel:false,
+						confirmText:'刷新'
+					})
+					if(mRes.confirm){
+						this.getOpenid();
+					}
+					return;
+				}else if(!this.payType){
+					this.$tools.msg('请选择支付方式')
+					return;
+				}else if(this.payType===1 &&    parseFloat(this.price || 0)  > parseFloat(this.userInfo.money || 0) ){
+					this.$tools.msg('您的余额不足')
+					return;
+				}
+				
+				let sendData={
+					id:this.orderId,
+					pay_type:this.payType,
+					openid: this.openid,
+				}
+				let res=await this.$request('order.pay',sendData);
+				let data = res.data;
+				if(this.payType == 1){
+					this.$refs.submitRef.chgeStatus();
+					this.navTo('/pages/public/paySuc',{},{type:'replace'})	
+				}else if (this.payType == 2) {
+					uni.requestPayment({
+						provider: 'wxpay',
+						timeStamp: data.timeStamp,
+						nonceStr: data.nonce_str,
+						package: data.prepay_id,
+						signType: data.signType,
+						paySign: data.paySign,
+						success: (res) => {
+							this.$refs.submitRef.chgeStatus();
+							this.navTo('/pages/public/paySuc',{},{type:'replace'})	
+						},
+						fail: function(err) {
+							//console.log('fail:' + JSON.stringify(err));
+							//that.$api.msg('fail:' + JSON.stringify(err))
+							that.$tools.msg('支付失败');
+						}
+					});
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+page{
+	background-color: #f8f8f8;
+}
+.page{
+	padding: 30rpx;
+}
+.p-top{
+	width: 690rpx;
+	height: 194rpx;
+	background: #FFFFFF;
+	box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(42,42,42,0.08);
+	border-radius: 20rpx;
+	.key{
+		font-size: 24rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #999999;
+		line-height: 37rpx;
+	}
+	.price{
+		margin-top: 28rpx;
+		font-size: 28rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #FF3E3E;
+		line-height: 37rpx;
+	}
+}
+.p-type{
+	margin-top: 24rpx;
+	width: 690rpx;
+	background: #FFFFFF;
+	box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(42,42,42,0.08);
+	border-radius: 20rpx;
+	padding: 0 20rpx;
+	margin-bottom: 154rpx;
+	.line{
+		height: 108rpx;
+		border-bottom: 2rpx solid #eee;
+		&:last-child{
+			border: none;
+		}
+		.key{
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #333333;
+		}
+		.money{
+			margin-left: 20rpx;
+			color: #333;
+			font-size: 28rpx;
+		}
+		.ic{
+			margin-left: auto;
+			width: 36rpx;
+			height: 36rpx;
+		}
+	}
+}
+.p-btn{
+	width: 690rpx;
+	height: 94rpx;
+	background: #92B99C;
+	border-radius: 47rpx;
+	font-size: 34rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #FFFFFF;
+	line-height: 94rpx;
+	text-align: center;
+	&.disabled{
+		background-color: #eee;
+	}
+}
+</style>

+ 91 - 0
pages/public/paySuc.vue

@@ -0,0 +1,91 @@
+<template>
+	<!-- 余额跳转 -->
+	<view class="page flex-col align-center">
+		<!-- 
+		<image src="/static/payOk.png" mode="aspectFill" class="img"></image>
+		<view class="title">支付成功</view>
+		<view class="val">{{money}} 元</view>
+		<view class="btn-wrap" @tap="navTo('/pages/home/index',{},'pushTab')">
+			返回首页
+		</view>
+		 -->
+		<view class="flex-col items-center group_3">
+		  <image
+		    src="/static/pay-ok.png"
+		    class="image_3"
+		  />
+		  <text class="text_2">恭喜您,支付成功</text>
+		  <view class="btns-wrap align-center">
+			 <view class="button" @tap="navTo('/pages/home/home',{},{type:'pushTab'})">
+				  <text >返回首页</text>
+			  </view>
+			  <view class="button" @tap="navTo('/pages/mine/mine',{},{type:'pushTab'})">
+					<text >查看订单</text>
+			  </view>	  
+		  </view>
+		 
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				id:'',
+				type:'',
+			};
+		},
+		onLoad(e){
+			this.id = e.id;
+			this.type = e.type;
+		},
+		methods:{
+		}
+	}
+</script>
+
+<style lang="scss">
+   page{
+      background: #f8f8f8;
+   }
+   .group_3 {
+     padding: 230rpx 0 30rpx;
+     flex: 1 1 auto;
+     overflow-y: auto;
+   }
+   .image_3 {
+     width: 100rpx;
+     height: 100rpx;
+   }
+   .text_2 {
+     margin-top: 39rpx;
+     color: #000;
+     font-size: 34rpx;
+     font-family: PingFang;
+     line-height: 35rpx;
+   }
+   .btns-wrap{
+	    margin-top: 230rpx;
+		.button {
+			 height: 60rpx;
+			 line-height: 58rpx;
+			 text-align: center;
+			 width: 175rpx;
+			 border: solid 1rpx #333333;
+			 border-radius: 10rpx;
+			 margin-right: 30rpx;
+			 font-size: 28rpx;
+			 &:last-child{
+				 margin-right: 0;
+			 }
+	    }	
+   }
+  
+   .text_3 {
+     color: #333333;
+     font-size: 34rpx;
+     font-family: PingFang;
+     line-height: 33rpx;
+   }
+</style>

二进制
static/pay-ok.png