Bläddra i källkod

花积分商店列表增加一个固定商家

lyb 4 år sedan
förälder
incheckning
75847765b5
3 ändrade filer med 88 tillägg och 4 borttagningar
  1. 3 0
      assets/http/api.js
  2. 50 2
      pages/consume/comps/card1.vue
  3. 35 2
      pages/consume/consume.vue

+ 3 - 0
assets/http/api.js

@@ -89,6 +89,9 @@ const shop = {
 	indexInfo: p => http.get("shop/indexInfo", {
 		params: p
 	}),
+	getBccH5SignAuthentication: p => http.get("client/user/getBccH5SignAuthentication", {
+		params: p
+	}),
 }
 
 //审核管理

+ 50 - 2
pages/consume/comps/card1.vue

@@ -10,6 +10,50 @@
 			</view>
 		</view>
 		<view class="item">
+			
+			<view class="card" @click="goDetail1" v-for="(item,index) in list1" :key="index">
+				<view class="left">
+					<image :src="item.cover" mode="aspectFill"></image>
+				</view>
+				<view class="right" style="width: 100%;">
+					<view class="title   flex justify-between" >
+						<view class="text-cut-1" style="width: 70%;">
+							<text class="">{{item.name}}</text>
+						</view>
+						<view v-if="vuex_audit==1" class="text-base center" style="font-size: 26rpx;font-weight: normal;">
+							<image class="" style="width: 32rpx;height: 32rpx;margin-right: 4rpx;" src="@/static/icon/order.png" mode=""></image>
+							<text>去下单</text>
+						</view>
+						
+					</view>
+					<view class="margin-bottom-20">
+						<view class="data">
+							<view class="">
+								<block>
+									<u-icon name="star-fill" color="#ff7001" size="30"></u-icon>
+									<text
+										style="margin-left: 4rpx;margin-right: 20rpx;color: #ff7001;font-size: 26rpx;">{{item.score}}</text>
+								</block>
+								<block>
+									<text>月售</text>
+									<text class="margin-left-10">{{item.sales==-1?0:item.sales}}</text>
+								</block>
+							</view>
+							<!-- <view>
+								<u-icon name="map-fill" color="#FF9447"></u-icon>
+								<text class="margin-left-10">{{distance(item.latitude,item.longitude)}} km</text>
+							</view> -->
+						</view>
+						<view class="text-cut-2" style="width: 100%;height: 32rpx;margin-top: 14rpx;">
+							<view v-for="(item1,index1) in item.labelKey.split(',')" :key="index1" class="cu-tag sm "
+								style="background-color: #fff0d9;color: #ffa353;">
+								{{item1}}
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			
 			<view class="card" @click="goDetail(item.id)" v-for="(item,index) in list" :key="index">
 				<view class="left">
 					<image :src="item.cover" mode="aspectFill"></image>
@@ -59,7 +103,8 @@
 <script>
 	export default{
 		props:{
-			list:Array
+			list:Array,
+			list1:Array
 		},
 		data(){
 			return {
@@ -104,11 +149,14 @@
 					}
 				})
 			},
+			goDetail1(id){
+				this.$emit('goDetail1')
+			},
 			filter(index){
 				this.activeIndex=index
 				console.log(this.activeIndex);
 				this.$emit('filter',index)
-			}
+			},
 		}
 	}
 </script>

+ 35 - 2
pages/consume/consume.vue

@@ -17,7 +17,7 @@
 			<view slot="swiper1">
 				<mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback"
 					@up="upCallback" :down="downOption" :up="upOption">
-					<card1 :list="shopList" @filter="filter"></card1>
+					<card1 :list="shopList" :list1="shopList1" @filter="filter" @goDetail1="goDetail1"></card1>
 				</mescroll-body>
 			</view>
 			<view slot="swiper2">
@@ -27,6 +27,7 @@
 				</mescroll-body>
 			</view>
 		</tabsSwiper>
+		<login ref="login"  @signIn="signIn"></login>
 	</view>
 </template>
 
@@ -35,12 +36,14 @@
 	import card2 from "./comps/card2.vue"
 	import card1 from "./comps/card1.vue"
 	import tabsSwiper from './comps/tabsSwiper.vue'
+	import login from "@/components/login.vue"
 	export default {
 		mixins: [MescrollMixin],
 		components: {
 			tabsSwiper,
 			card1,
-			card2
+			card2,
+			login
 		},
 		data() {
 			return {
@@ -52,6 +55,15 @@
 				//数据列表
 				list: [],
 				shopList: [],
+				shopList1: [{
+					cover: 'https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/c3f3d4e115ad437b98157c01d5c7e3de-%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20211229114436.jpg',
+					name: '彩食鲜',
+					score: 5,
+					sales: 10,
+					latitude: 0,
+					longitude: 0,
+					labelKey: '网店'
+				}],
 				mallList: [],
 				//当前taginedx
 				current: 0,
@@ -101,6 +113,27 @@
 				}
 				this.mescroll.resetUpScroll();
 			},
+			goDetail1(){
+				if (this.$isEmpty(this.vuex_phone) || this.$isEmpty(uni.getStorageSync('userInfo'))) {
+					this.$refs.login.show()
+				}else{
+					this.BccH5SignAuthentication();
+				}
+			},
+			async BccH5SignAuthentication(){
+				let params = {
+					code: this.vuex_phone,
+					name: uni.getStorageSync('userInfo').nickName,
+					telephone: this.vuex_phone
+				}
+				let res = await this.$api.shop.getBccH5SignAuthentication(params)
+				if(res.success){
+					uni.navigateTo({
+						url: "/pages/webview/webview?url=" + res.data
+					})
+				}
+				
+			},
 			async fetchShopList(mescroll) {
 				let params = {
 					current: mescroll.num,