vaecebyZ 1 rok temu
rodzic
commit
1a66fa9741

+ 3 - 1
detail/goodsDetail/index.vue

@@ -127,7 +127,9 @@ export default {
       active: 0,
       tab: 1,
       shopList: [],
-      info: {},
+      info: {
+        specs: [{ specValues: [] }],
+      },
       shopInfo: {},
     };
   },

+ 1 - 0
login/login/login.vue

@@ -113,6 +113,7 @@
 								wechatLogin({
 									jsCode: r.code,
 									phone: data.content,
+									loginType:"GZU",
 									loginToken: msg.content
 								}).then(res => {
 									uni.hideLoading()

+ 2 - 1
pages/index/index.vue

@@ -188,6 +188,7 @@ export default {
     this.navBarHeight = this.$navHight(1);
     this.navBarHeight = this.navBarHeight + 10 + "px";
     this.statusBarHeight = uni.getSystemInfoSync()["statusBarHeight"];
+    this.query.shopId = uni.getStorageSync("gdShopId");
     Promise.all([
       this.getSearchMenu(),
       this.getAdv(),
@@ -195,7 +196,7 @@ export default {
       this.getBanner(),
       this.getCity(),
     ]).then((res) => {});
-    this.query.shopId = uni.getStorageSync("gdShopId");
+   
   },
   methods: {
 		goGoodsDetail(item) {

+ 344 - 289
pages/index/searchResult.vue

@@ -1,297 +1,352 @@
 <template>
-	<view class="searchResult">
-		<zs-choose-tab :tabList="tabList" @choose="chooseTab"></zs-choose-tab>
-		<zs-list mt="0" @load="loadMore" :status="status">
-			<view class="item" v-for="(item,index) in list" :key="index">
-					<zs-img class="icon" :src="item.logoPath" radius="full" width="120rpx" height="120rpx" @click="goShopDetail(item)"></zs-img>
-				<view class="shop-box">
-					<view class="shop-info">
-						<view class="shop-name" @click="goShopDetail(item)">
-							{{item.goodsName}}
-						</view>
-						<view class="address-box">
-							<view class="address">
-								{{item.goodsDescribe}} 
-							</view>
-							<view class="distance">
-								<!-- {{(item.shopVo.distance/1000).toFixed(2)}}km -->
-							</view>
-						</view>
-					</view>
-	
-					<!-- <view class="goods-list"> -->
-						<scroll-view class="goods-list" enable-flex scroll-x="true">
-						<view class="goods-item" v-for="(i,d) in 1" :key="d"  @click="goGoodsDetail(item,i)">
-							<zs-img :src="i.goodsImg" width="160rpx" height="160rpx"></zs-img>
-							<view class="goods-name">
-							{{item.goodsName}}
-							</view>
-							<view class="price-box">
-									<view class="price">
-									¥{{item.realPrice}}
-									</view>
-									<view class="old-price">
-										 ¥{{item.marketPrice}}
-									</view>
-							</view>
-						</view>
-	
-						</scroll-view>
-					<!-- </view> -->
-				</view>
-			</view>
-		</zs-list>
-	</view>
+  <view class="searchResult">
+    <zs-choose-tab :tabList="tabList" @choose="chooseTab"></zs-choose-tab>
+
+    <view class="goods-list">
+      <zs-list class="store-box" mt="0" @load="loadMore" :status="status">
+        <view class="left">
+          <view
+            class="store-item"
+            v-for="(item, index) in list"
+            :key="index"
+            @click="goGoodsDetail(item)"
+          >
+            <zs-img
+              :src="item.goodsImg"
+              width="340rpx"
+              height="340rpx"
+              mode="widthFix"
+            ></zs-img>
+            <view class="info">
+              <view class="title">
+                {{ item.goodsName }}
+              </view>
+              <view class="goods-price">
+                <view> ¥{{ item.realPrice }} </view>
+                <view class="distance">
+                  销售{{ item.saleNum.toFixed(2) }}
+                </view>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view class="right">
+          <view
+            class="store-item"
+            v-for="(item, index) in list1"
+            :key="index"
+            @click="goGoodsDetail(item)"
+          >
+            <zs-img
+              :src="item.goodsImg"
+              width="340rpx"
+              height="340rpx"
+              mode="widthFix"
+            ></zs-img>
+            <view class="info">
+              <view class="title">
+                {{ item.goodsName }}
+              </view>
+              <view class="goods-price">
+                <!-- <image
+                  class="position"
+                  src="../../static/position.png"
+                  mode=""
+                ></image> -->
+                <view> ¥{{ item.realPrice }}</view>
+                <view class="distance">
+                  销售{{ item.saleNum.toFixed(2) }}
+                </view>
+              </view>
+            </view>
+          </view>
+        </view>
+      </zs-list>
+    </view>
+  </view>
 </template>
 
 <script>
-	import {
-		appSearch
-	} from '@/api/shop.js';
-	import {
-		getMenu,
-	} from '@/api/common.js'
-	export default {
-		data() {
-			return {
-				location:'',
-				query: {
-					district:'',
-					pageCurrent: 1,
-					pageSize: 10,
-					'location.lat': 0,
-					'location.lon': 0,
-					range:'',
-					goodsName: '',
-					shopId:'',
-					status: 3,
-				},
-				status: 'more',
-				list: [],
-				tabList: [
-					// {
-					// 	id: 1,
-					// 	label: '区域',
-					// 	list: [
-				
-					// 		{
-					// 			id: 1,
-					// 			label: '观山湖'
-					// 		},
-					// 		{
-					// 			id: 2,
-					// 			label: '白云区'
-					// 		},
-					// 		{
-					// 			id: 3,
-					// 			label: '花果山区'
-					// 		}
-					// 	]
-					// },
-					{
-						id: 1,
-						label: '全部分类',
-						list: []
-					},
-					
-					// {
-					// 	id: 1,
-					// 	label: '附近',
-					// 	list: [
-					// 		{
-					// 			id:5,
-					// 			label: '5KM'
-					// 		},
-					// 		{
-					// 			id:10,
-					// 			label: '10KM'
-					// 		},
-					// 		{
-					// 			id:20,
-					// 			label: '20KM'
-					// 		},
-					// 		{
-					// 			id:50,
-					// 			label: '50KM'
-					// 		}
-					// 	]
-					// },
-				]
-			}
-		},
-		methods: {
-			goShopDetail(item) {
-				uni.setStorageSync('shopInfo', JSON.stringify(item))
-				uni.navigateTo({
-					url: '/detail/shopDetail/shopDetail'
-				})
-			},
-			goGoodsDetail(item,i) {
-				uni.setStorageSync('shopInfo', JSON.stringify(item))
-				uni.reLaunch({
-					url: `/detail/goodsDetail/index?id=${i.goodsId}`
-				})
-			},
-			chooseTab(val) {
-				console.log(val);
-				this.query.range = val[2].id
-				if(val[0]){
-					this.query['location.lat'] = val[0].location.lat
-					this.query['location.lon'] = val[0].location.lng
-					this.query.range = 50
-					this.query.district = val[0].label
-				}else if(!val[0]){
-					this.query['location.lat'] = this.location.latitude
-					this.query['location.lon'] = this.location.longitude
-					this.query.district = ''
-				}
-				if(val[1]){
-					this.query.menuId = val[1].id
-				}else if(!val[1]){
-					this.query.menuId = ''
-				}
-				this.query.pageCurrent = 1
-				this.status = 'more'
-				this.list = []
-				this.search()
-			},
-			search() {
-				// if(this.status == 'noMore') return
-				this.status = 'loading'
-				let obj = JSON.parse(JSON.stringify(this.query))
-				if(!obj.range){
-					delete obj.range
-				}
-				appSearch(obj).then(res => {
-					if (res.state == 'Success') {
-						this.list = this.list.concat(res.content.records)
-						console.log(res.content.total>=this.list.length);
-						if(res.content.total>this.list.length){
-							this.status = 'more'
-						}else{
-							this.status = 'noMore'
-							this.query.pageCurrent++
-						}
-					}
-				})
-			},
-			loadMore() {
-				this.search()
-			},
-			// 金刚区
-			getMenu(){
-					getMenu({currentPage:1,pageSize:10,status:2}).then(res=>{
-						if(res.state == 'Success'){
-							let list = []
-							res.content.records.map(item => {
-								list.push({
-									id: item.id,
-									label: item.menuName
-								})
-							})
-							this.tabList[1].list = list
-						}
-					})
-			},
-		},
-		onLoad(options) {
-			this.tabList[0].list = JSON.parse(uni.getStorageSync('districtList'))
-			this.location = JSON.parse(uni.getStorageSync('location'))
-			this.query.shopId = uni.getStorageSync("gdShopId");
-			this.query['location.lat'] = this.location.latitude
-			this.query['location.lon'] = this.location.longitude
-			this.query.goodsName = options.search
-			this.search()
-			this.getMenu()
-		}
-	}
+import { appSearch } from "@/api/shop.js";
+import { getMenu } from "@/api/common.js";
+export default {
+  data() {
+    return {
+      location: "",
+      query: {
+        district: "",
+        pageCurrent: 1,
+        pageSize: 10,
+        "location.lat": 0,
+        "location.lon": 0,
+        range: "",
+        goodsName: "",
+        shopId: "",
+        status: 3,
+      },
+      status: "more",
+      list: [],
+      list1: [],
+      tabList: [
+        // {
+        // 	id: 1,
+        // 	label: '区域',
+        // 	list: [
+
+        // 		{
+        // 			id: 1,
+        // 			label: '观山湖'
+        // 		},
+        // 		{
+        // 			id: 2,
+        // 			label: '白云区'
+        // 		},
+        // 		{
+        // 			id: 3,
+        // 			label: '花果山区'
+        // 		}
+        // 	]
+        // },
+        {
+          id: 1,
+          label: "全部分类",
+          list: [],
+        },
+
+        // {
+        // 	id: 1,
+        // 	label: '附近',
+        // 	list: [
+        // 		{
+        // 			id:5,
+        // 			label: '5KM'
+        // 		},
+        // 		{
+        // 			id:10,
+        // 			label: '10KM'
+        // 		},
+        // 		{
+        // 			id:20,
+        // 			label: '20KM'
+        // 		},
+        // 		{
+        // 			id:50,
+        // 			label: '50KM'
+        // 		}
+        // 	]
+        // },
+      ],
+    };
+  },
+  methods: {
+    goShopDetail(item) {
+      uni.setStorageSync("shopInfo", JSON.stringify(item));
+      uni.navigateTo({
+        url: "/detail/shopDetail/shopDetail",
+      });
+    },
+    goGoodsDetail(item, i) {
+      uni.setStorageSync("shopInfo", JSON.stringify(item));
+      uni.reLaunch({
+        url: `/detail/goodsDetail/index?id=${item.goodsId}`,
+      });
+    },
+    chooseTab(val) {
+      console.log(val);
+      this.query.range = val[2].id;
+      if (val[0]) {
+        this.query["location.lat"] = val[0].location.lat;
+        this.query["location.lon"] = val[0].location.lng;
+        this.query.range = 50;
+        this.query.district = val[0].label;
+      } else if (!val[0]) {
+        this.query["location.lat"] = this.location.latitude;
+        this.query["location.lon"] = this.location.longitude;
+        this.query.district = "";
+      }
+      if (val[1]) {
+        this.query.menuId = val[1].id;
+      } else if (!val[1]) {
+        this.query.menuId = "";
+      }
+      this.query.pageCurrent = 1;
+      this.status = "more";
+      this.list = [];
+      this.search();
+    },
+    search() {
+      // if(this.status == 'noMore') return
+      this.status = "loading";
+      let obj = JSON.parse(JSON.stringify(this.query));
+      if (!obj.range) {
+        delete obj.range;
+      }
+      appSearch(obj).then((res) => {
+        if (res.state == "Success") {
+          this.loading = false;
+          let list = [];
+          let list1 = [];
+          res.content.records.map((item, index) => {
+            if (index % 2) {
+              list1.push(item);
+            } else {
+              list.push(item);
+            }
+          });
+          this.list = this.list.concat(list);
+          this.list1 = this.list1.concat(list1);
+          let total = this.list.length + this.list1.length;
+          console.log("list", this.list, this.list1);
+          if (total >= res.content.total) {
+            this.status = "noMore";
+          } else {
+            this.status = "more";
+            this.query.currentPage++;
+          }
+        }
+      });
+    },
+    loadMore() {
+      this.search();
+    },
+    // 金刚区
+    getMenu() {
+      getMenu({ currentPage: 1, pageSize: 10, status: 2 }).then((res) => {
+        if (res.state == "Success") {
+          let list = [];
+          res.content.records.map((item) => {
+            list.push({
+              id: item.id,
+              label: item.menuName,
+            });
+          });
+          // this.tabList[1].list = list;
+        }
+      });
+    },
+  },
+  onLoad(options) {
+    let list = uni.getStorageSync("districtList") || "[]";
+    this.tabList[0].list = JSON.parse(list);
+    this.location = JSON.parse(uni.getStorageSync("location"));
+    this.query.shopId = uni.getStorageSync("gdShopId");
+    this.query["location.lat"] = this.location.latitude;
+    this.query["location.lon"] = this.location.longitude;
+    this.query.goodsName = options.search;
+    this.search();
+    // this.getMenu();
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-.searchResult{
-	padding: 100rpx 24rpx 20rpx;
-	background: #F9F9F9;
-	.item{
-		padding: 24rpx;
-		background: #FFFFFF;
-		border-radius: 16rpx 16rpx 16rpx 16rpx;
-		display: flex;
-		align-items: flex-start;
-		margin-bottom: 20rpx;
-		
-		.icon{
-			width: 120rpx;
-		}
-		.shop-box{
-			flex: 1;
-				margin-left: 20rpx;
-			.shop-info{
-				.shop-name{
-					font-weight: 600;
-					font-size: 36rpx;
-					color: #222222;
-					width: 100%;
-					white-space: nowrap;
-					overflow: hidden;
-					text-overflow: ellipsis;
-				}
-				.address-box{
-					display: flex;
-					justify-content: space-between;
-					align-items: center;
-					font-weight: 300;
-					font-size: 24rpx;
-					color: #AAAAAA;
-					margin-top: 25rpx;
-					.address{
-						width: 400rpx;
-						white-space: nowrap;
-						overflow: hidden;
-						text-overflow: ellipsis;
-					}
-				}
-			}
-			.goods-list{
-				display: flex;
-				align-items: flex-start;
-				margin-top: 20rpx;
-				overflow: auto;
-				width: calc(750rpx - 94rpx - 120rpx - 20rpx);
-				.goods-item{
-					display: inline-block;
-					width: 160rpx;
-					margin-right: 20rpx;
-					.goods-name{
-						margin-top: 20rpx;
-						width: 100%;
-						overflow: hidden;
-						text-overflow: ellipsis;
-						/* 弹性伸缩盒子模型显示 */
-						display: -webkit-box;
-						/* 限制在一个块元素显示的文本的行数 */
-						-webkit-line-clamp: 2;
-						/* 设置或检索伸缩盒对象的子元素的排列方式 */
-						-webkit-box-orient: vertical;
-					}
-				}
-				.price-box{
-					display: flex;
-					align-items: center;
-					margin-top: 20rpx;
-					.price{
-						font-weight: 600;
-						font-size: 28rpx;
-						color: #FF4D3A;
-					}
-					.old-price{
-						font-weight: 300;
-						font-size: 20rpx;
-						color: #AAAAAA;
-						text-decoration: line-through;
-					}
-				}
-			}
-		}
-	}
+.searchResult {
+  padding: 100rpx 24rpx 20rpx;
+  background: #f9f9f9;
+  .goods-list {
+    border-radius: 16rpx 16rpx 0 0;
+    margin-bottom: 60rpx;
+  }
+}
+
+::v-deep .zs-list {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
+
+  .left {
+    .adv-swiper {
+      width: 340rpx;
+      height: 444rpx;
+      margin-bottom: 25rpx;
+
+      .adv-item {
+        width: 340rpx;
+        height: 444rpx;
+      }
+    }
+  }
+
+  .right {
+  }
+
+  .store-item {
+    width: 340rpx;
+    margin-bottom: 25rpx;
+    // box-shadow: 0rpx 0rpx 24rpx 2rpx rgba(0, 0, 0, 0.08);
+    border-radius: 16rpx;
+    background: #fff;
+
+    .icon {
+      width: 100%;
+      height: 300rpx;
+      border-radius: 16rpx 16rpx 0 0;
+    }
+
+    .info {
+      padding: 20rpx;
+      background: #fff;
+      border-radius: 0 0 16rpx 16rpx;
+      position: relative;
+
+      .title {
+        // font-weight: bold;
+        width: 100%;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        overflow: hidden;
+      }
+
+      .tags {
+        display: flex;
+        align-items: center;
+
+        .tag-item {
+          line-height: 50rpx;
+          border-radius: 8rpx;
+          padding: 6rpx 0;
+          font-size: 24rpx;
+          margin-left: 10rpx;
+          display: flex;
+
+          .label {
+            background: #fff;
+            color: #fe5b47;
+            padding: 0 10rpx;
+            border-radius: 8rpx 0 0 8rpx;
+          }
+
+          .value {
+            color: #fff;
+            background: rgba(255, 255, 255, 0.2);
+            padding: 0 14rpx;
+            border-radius: 0 8rpx 8rpx 0;
+          }
+        }
+      }
+
+      .goods-price {
+        display: flex;
+        align-items: center;
+        margin-top: 15rpx;
+        justify-content: space-between;
+        color: #ff4d3a;
+        font-weight: bold;
+        font-size: 30rpx;
+        .distance {
+          font-weight: normal;
+          font-size: 20rpx;
+          color: #999;
+        }
+
+        .position {
+          color: 999;
+          width: 25rpx;
+          height: 29rpx;
+          margin-right: 8rpx;
+        }
+      }
+    }
+  }
 }
-</style>
+</style>

+ 1 - 1
pages/my/index.vue

@@ -139,7 +139,7 @@ export default {
     this.navBarHeight = this.$navHight();
   },
   onShow() {
-    init();
+    this.init();
   },
   methods: {
     init() {

+ 57 - 45
pay/pay.vue

@@ -204,7 +204,7 @@
 						}catch(e){
 							extend = this.info.reservationTime || ''
 						}
-						
+						extend.channel = "GZU" //贵大订单
 						creat({
 							discountId: (this.payInfo.couponGoodsLogId || this.payInfo.couponGoodsLogId == -1) ? [this
 								.payInfo.couponGoodsLogId
@@ -222,52 +222,64 @@
 										url: '/my/order/index'
 									})
 								} else {
-									this.query.orderNo = res.content.orderNo
-									this.query.subOpenId = JSON.parse(uni.getStorageSync('userInfo')).openId
-									this.query.orderDesc = this.info.goodsName
-									creatPayOrder(this.query).then(data => {
-										that.payData = JSON.parse(data.content.miniPayRequest)
-										if (data.content.miniPayRequest == null) return uni.hideLoading()
-										uni.requestPayment({
-											"provider": "wxpay",
-											"orderInfo": that.payData,
-											"appid": that.payData
-											.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
-											"paySign": that.payData.paySign,
-											"nonceStr": that.payData.nonceStr, // 随机字符串
-											"package": that.payData.package, // 固定值
-											// "prepayid":  that.payData.package, // 统一下单订单号 
-											"timeStamp": that.payData.timeStamp, // 时间戳(单位:秒)
-											"signType": that.payData.signType, //签名算法
-											success(msg) {
-												console.log('msg', msg, res);
-												queryPayOrder(that.query.orderNo).then(res1 => {
-													if (res1.state == 'Success') {
-														uni.hideLoading()
-														uni.reLaunch({
-															url: '/my/order/index'
-														})
-													}
-												})
-											},
-											fail(e) {
-												console.log('err', e);
-												that.loading = false
-												uni.hideLoading()
-												uni.showToast({
-													title: '取消支付',
-													icon: 'fail'
-												})
-												// 取消支付后,获取支付信息以备再次支付
-												payDetails(that.query.orderNo).then(r => {
-													if (r.state == 'Success') {
-													that.payData = JSON.parse(r.content.miniPayRequest)
-													}
-												})
-											}
-										})
+									// 创建订单完成。
 
+									this.query.orderNo = res.content.orderNo
+									// this.query.subOpenId = JSON.parse(uni.getStorageSync('userInfo')).openId
+									// this.query.orderDesc = this.info.goodsName
+									// creatPayOrder(this.query).then(data => {
+									// 	that.payData = JSON.parse(data.content.miniPayRequest)
+									// 	if (data.content.miniPayRequest == null) return uni.hideLoading()
+									// 	uni.requestPayment({
+									// 		"provider": "wxpay",
+									// 		"orderInfo": that.payData,
+									// 		"appid": that.payData
+									// 		.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
+									// 		"paySign": that.payData.paySign,
+									// 		"nonceStr": that.payData.nonceStr, // 随机字符串
+									// 		"package": that.payData.package, // 固定值
+									// 		// "prepayid":  that.payData.package, // 统一下单订单号 
+									// 		"timeStamp": that.payData.timeStamp, // 时间戳(单位:秒)
+									// 		"signType": that.payData.signType, //签名算法
+									// 		success(msg) {
+									// 			console.log('msg', msg, res);
+									// 			queryPayOrder(that.query.orderNo).then(res1 => {
+									// 				if (res1.state == 'Success') {
+									// 					uni.hideLoading()
+									// 					uni.reLaunch({
+									// 						url: '/my/order/index'
+									// 					})
+									// 				}
+									// 			})
+									// 		},
+									// 		fail(e) {
+									// 			console.log('err', e);
+									// 			that.loading = false
+									// 			uni.hideLoading()
+									// 			uni.showToast({
+									// 				title: '取消支付',
+									// 				icon: 'fail'
+									// 			})
+									// 			// 取消支付后,获取支付信息以备再次支付
+									// 			payDetails(that.query.orderNo).then(r => {
+									// 				if (r.state == 'Success') {
+									// 				that.payData = JSON.parse(r.content.miniPayRequest)
+									// 				}
+									// 			})
+									// 		}
+									// 	})
+									// })
+
+									// 跳转到支付页面
+									// /oreder/detail
+									uni.redirectTo({
+										url: '/my/order/detail?id='+res.content.orderNo,
+										success() {
+											that.loading = false
+											uni.hideLoading()
+										}
 									})
+
 								}
 
 							}