gcz hace 2 años
padre
commit
90ab092b16

+ 2 - 1
center/mystore.vue

@@ -51,7 +51,8 @@
 					},
 					noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
 					empty: {
-						tip: '暂无相关数据'
+						tip: '~暂无店铺~',
+						icon:'../static/img/empty.png'
 					}
 				},
 				tabsList:[],

+ 20 - 51
center/paycode.vue

@@ -8,79 +8,48 @@
 		>
 		</u-navbar>
 		<view class="content">
-			<view class="ayQrcode" @click="refreshCode">
-				<ayQrcode 
-					ref="qrcode" 
-					:modal="modal_qr" 
-					:url="qrContent" 
-					@hideQrcode="hideQrcode" 
-					:is_themeImg="true"
-					themeImg="../static/qrlogo.png"
-					:h_w_img="65"
-					:height="250" :width="250" />
-			</view>
+			<img class="qrCode" :src="details.qrCode" alt="">
 			<view class="tip">仅限消费者注册使用</view>
-			<text class="save">保存本地</text>
+			<text class="save" @click="save">保存本地</text>
 		</view>
 	</view>
 </template>
 
 <script>
-	import ayQrcode from "@/components/ay-qrcode/ay-qrcode.vue"
+	import {downloadImage} from '@/utils/downloadImage.js';
 	export default {
 		components:{
-			ayQrcode
+			
 		},
 		data() {
 			return {
+				id:'',
 				staticUrl:this.$commonConfig.staticUrl,
-				modal_qr: false,
-				qrContent: {}, // 要生成的二维码值
-				timer: null,
-				
+				details:{}
 			}
 		},
 		onShow() {
 		},
-		onLoad() {
-			this.qrContent.qrcode = this.vuex_user_info.userid;
-			// this.qrContent.time = Date.now();
-			this.qrContent = JSON.stringify(this.qrContent);
-			let that = this;
-			// this.timer = setInterval(() => {
-			//   this.refreshCode()
-			// }, 30000);
+		onLoad(page) {
+			console.log('page',page);
+			this.id = page.id;
+			this.getPageData()
 		},
 		onUnload() {
-		    // 页面离开时停止计时器
-		    // clearInterval(this.timer)
 		},
 		onReady() {
-			let that = this;
-			that.showQrcode();//一加载生成二维码
 		},
 		methods: {
-			// 展示二维码
-			showQrcode() {
-				let _this = this;
-				this.modal_qr = true;
-				// uni.showLoading()
-				setTimeout(function() {
-					// uni.hideLoading()
-					_this.$refs.qrcode.crtQrCode()
-				}, 50)
+			getPageData(){
+				this.$u.api.shopById({id:this.id}).then(res=>{
+					this.details = res.data;
+					// console.log('getPageData',this.details);
+				}).catch(err=>{
+					console.log('getPageData',err);
+				})
 			},
-
-			//传入组件的方法
-			hideQrcode() {
-				this.modal_qr = false;
-			},
-			refreshCode(){
-				this.qrContent = {};
-				this.qrContent.qrcode = this.vuex_user_info.userid;
-				this.qrContent.time = Date.now();
-				this.qrContent = JSON.stringify(this.qrContent);
-				this.showQrcode()
+			save(){
+				downloadImage(this.details.qrCode, this.details.name);
 			}
 		}
 	}
@@ -98,7 +67,7 @@ page{
 	border-radius: 8rpx;
 	padding: 100rpx 20rpx;
 	box-sizing: border-box;
-	.ayQrcode{
+	.qrCode{
 		width: 250px;
 		height: 250px;
 	}

+ 129 - 9
center/store.vue

@@ -17,19 +17,58 @@
 				:autoplay="false"
 				indicatorStyle="right: 20px"
 			>
-				<view
-					slot="indicator"
-					class="indicator-num"
-				>
+				<view slot="indicator" class="indicator-num">
 					<text class="indicator-num__text">{{ currentNum + 1 }}/{{ details.slideImgList.length }}</text>
 				</view>
 			</u-swiper>
-			<view class="info">
-				<view class="title">
-					
+		</view>
+		<view class="info">
+			<view class="title">店铺信息</view>
+			<view class="info-item">
+				<view class="left">门店地址:{{details.address}}</view>
+			</view>
+			<view class="info-item u-flex u-row-between">
+				<view class="left">营业时间:{{details.workTime}}</view>
+				<view class="right update" @click="timeShow = true">更新</view>
+			</view>
+			<view class="info-item u-flex u-row-between">
+				<view class="left">联系电话:{{details.tel}}</view>
+				<view class="right update" @click="telShow = true">更新</view>
+			</view>
+			<view class="info-item u-flex u-row-between">
+				<view class="left">
+					门店推广码:
+					<text @click="$u.route('/center/paycode',{id:details.id})" style="color: #00A447;">查看</text>
+				</view>
+			</view>
+			<view class="info-item u-flex u-col-top">
+				<view class="left">店铺资质:</view>
+				<view class="imgs">
+					<u-album :urls="details.certificationList"></u-album>
 				</view>
 			</view>
 		</view>
+		<u-modal :show="telShow"  title="修改联系电话" @confirm="changeTel" @cancel="telShow=false" :showCancelButton="true" >
+			<view class="slot-content">
+				<u--input
+				    placeholder="请输入联系电话"
+				    border="surround"
+				    v-model="tempTel"
+				  >
+				</u--input>
+			</view>
+		</u-modal>
+		<u-modal :show="timeShow"  title="修改营业时间" @confirm="changeTime" @cancel="timeShow=false" :showCancelButton="true" >
+			<view class="slot-content">
+				<u--input
+				    placeholder="营业时间如:09:00~18:00"
+				    border="surround"
+				    v-model="tempTime"
+				  >
+				</u--input>
+			</view>
+		</u-modal>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -40,6 +79,10 @@
 				id:'',
 				details:{slideImgList:[]},
 				currentNum:0,
+				telShow:false,
+				tempTel:'',
+				timeShow:false,
+				tempTime:'',
 			}
 		},
 		onShow() {
@@ -49,14 +92,66 @@
 			this.getPageData();
 		},
 		methods: {
+			leftClick(){
+				console.log('leftClick');
+			},
 			getPageData(){
 				this.$u.api.shopById({id:this.id}).then(res=>{
 					this.details = res.data;
-					console.log('getPageData',this.details);
+					// console.log('getPageData',this.details);
 				}).catch(err=>{
 					console.log('getPageData',err);
 				})
 			},
+			shopUpdate(type){
+				let params ={
+					id:this.id
+				};
+				if(type == 'workTime'){
+					params.workTime = this.tempTime;
+				}else if(type == 'tel'){
+					params.tel = this.tempTel;
+				}
+				this.$u.api.shopUpdate(params).then(res=>{
+					this.getPageData();
+				}).catch(err=>{
+					console.log('err',err);
+				})
+			},
+			changeTime(){
+				let that = this;
+				this.timeShow = false;
+				if(this.tempTime.length<1){
+					this.$refs.uToast.show({
+						type: 'error',
+						title: '提示',
+						message: "请输入营业时间",
+						complete(){
+							that.timeShow = true
+						}
+					})
+				}else{
+					this.shopUpdate('workTime')
+				}
+			},
+			changeTel(){
+				let that = this;
+				// let isTel = uni.$u.test.mobile(this.tempTel);
+				let isEmpty = uni.$u.test.isEmpty(this.tempTel);
+				this.telShow = false;
+				if(isEmpty){
+					this.$refs.uToast.show({
+						type: 'error',
+						title: '提示',
+						message: "请输入联系电话",
+						complete(){
+							that.telShow = true
+						}
+					})
+				}else{
+					this.shopUpdate('tel')
+				}
+			}
 		}
 	}
 </script>
@@ -66,5 +161,30 @@ page{
 }
 </style>
 <style lang="scss" scoped>
-
+.info{
+	margin-top: 24rpx;
+	background-color: #fff;
+	padding: 28rpx 30rpx 30rpx 0;
+	.title{
+		margin-bottom: 20rpx;
+		font-size: 32rpx;
+		font-weight: 400;
+		color: #333333;
+		line-height: 45rpx;
+		border-left: 2px solid #00A447;
+		padding-left: 26rpx;
+	}
+	.info-item{
+		margin-left: 30rpx;
+		font-size: 30rpx;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #999999;
+		line-height: 42rpx;
+		margin-bottom: 20rpx;
+		.update{
+			color: #333;
+		}
+	}
+}
 </style>

+ 30 - 5
common/apiurl.js

@@ -47,6 +47,11 @@ const apiurl = {
 		url: '/agentInfo/shopById',
 		type: 'get'
 	},
+	//店铺更新
+	shopUpdate: {
+		url: '/agentInfo/shopUpdate',
+		type: 'put'
+	},
 	//轮播图
 	swiperList: {
 		url: '/advList/pageList',
@@ -57,11 +62,6 @@ const apiurl = {
 		url: '/advList/selectById',
 		type: 'get'
 	},
-	// 旭烁简介
-	xsGetIntro: {
-		url: '/shop/getIntro',
-		type: 'get'
-	},
 	// 热销商品列表
 	topGoodList: {
 		url: '/goods/selectTopGoodList',
@@ -87,6 +87,31 @@ const apiurl = {
 		url: '/goods/memberGetById',
 		type: 'get'
 	},
+	// 购物车列表
+	cartList: {
+		url: '/agentGoodsCart/pageList',
+		type: 'get'
+	},
+	// 购物车添加
+	addCart: {
+		url: '/agentGoodsCart/insert',
+		type: 'post'
+	},
+	// 购物车数量修改
+	updateQuantity: {
+		url: '/agentGoodsCart/modifyCart',
+		type: 'put'
+	},
+	// 购物车批量删除
+	deleteCarts: {
+		url: '/agentGoodsCart/deleteByIds',
+		type: 'delete'
+	},
+	// 订单提交
+	submitOrder: {
+		url: '/agentOrder/submit',
+		type: 'post'
+	},
 }
 
 

+ 8 - 15
pages/index/index.vue

@@ -22,23 +22,23 @@
 					需要删除
 				</view> -->
 				<view class="nav-item" @click="$u.route('/shopping/producTypetList',{})">
-					<u--image class="image" :src="staticUrl+'/img/index-nav-1.png'" width="101rpx" height="101rpx"></u--image>
+					<u--image class="image" src="../../static/img/index-nav-1.png" width="101rpx" height="101rpx"></u--image>
 					选品
 				</view>
 				<view class="nav-item" @click="$u.route('/shopping/cart',{})">
-					<u--image class="image" :src="staticUrl+'/img/index-nav-2.png'" width="101rpx" height="101rpx"></u--image>
+					<u--image class="image" src="../../static/img/index-nav-2.png" width="101rpx" height="101rpx"></u--image>
 					购物车
 				</view>
 				<view class="nav-item" @click="$u.route('/center/dealList',{})">
-					<u--image class="image" :src="staticUrl+'/img/index-nav-3.png'" width="101rpx" height="101rpx"></u--image>
+					<u--image class="image" src="../../static/img/index-nav-3.png" width="101rpx" height="101rpx"></u--image>
 					我的业绩
 				</view>
 				<view class="nav-item" @click="$u.route('/center/client',{type:'reLaunch'})">
-					<u--image class="image" :src="staticUrl+'/img/index-nav-4.png'" width="101rpx" height="101rpx"></u--image>
+					<u--image class="image" src="../../static/img/index-nav-4.png" width="101rpx" height="101rpx"></u--image>
 					我的会员
 				</view>
 				<view class="nav-item" @click="$u.route('/center/mystore',{type:'reLaunch'})">
-					<u--image class="image" :src="staticUrl+'/img/index-nav-4.png'" width="101rpx" height="101rpx"></u--image>
+					<u--image class="image" src="../../static/img/index-nav-5.png" width="101rpx" height="101rpx"></u--image>
 					我的门店
 				</view>
 			</view>
@@ -57,21 +57,14 @@
 						<view class="u-flex u-row-between">
 							<view class="left">
 								<view class="up">
-									<view class="" v-if="vuex_member_info.priceType>1">
-										<text class="price">¥ <text class="price-num">{{item.vipPrice}}</text></text>
-										<text class="vip-icon">VIP</text>
-									</view>
-									<view class="" v-else>
-										<text class="price">¥ <text class="price-num">{{item.salePrice}}</text></text>
+									<view class="">
+										<text class="price">¥ <text class="price-num">{{item.patchPrice}}</text></text>
 									</view>
 								</view>
 								<view class="down">
-									<!-- <text class="discount">8.8折</text> -->
-									<text v-if="vuex_member_info.priceType>1" class="original-price gray line-through">¥ {{item.salePrice}}</text>
-									<!-- <text class="sales gray">销量 {{item.salePrice}}</text> -->
+									<text class="original-price gray line-through">¥ {{item.salePrice}}</text>
 								</view>
 							</view>
-							<!-- <u--image :showLoading="false" @click.native.stop="addCart(item.id)" :src="staticUrl+'/img/add.png'" width="48rpx" height="48rpx"></u--image> -->
 							<view class="btn">去看看</view>
 						</view>
 					</view>

+ 34 - 63
shopping/cart.vue

@@ -28,20 +28,8 @@
 						<view class="name ellipsis-2" @click="$u.route('/shopping/productdetails',{id:item.goodsId})">{{item.goodsName}}</view>
 						<view class="u-flex u-row-between">
 							<view class="left">
-								<view class="up">
-									<view class="" v-if="vuex_member_info.priceType>1">
-										<text class="price">¥ <text class="price-num">{{item.vipPrice}}</text></text>
-										<text class="vip-icon">VIP</text>
-									</view>
-									<view class="" v-else>
-										<text class="price">¥ <text class="price-num">{{item.salePrice}}</text></text>
-									</view>
-								</view>
-								<view class="down">
-									<!-- <text class="discount">8.8折</text> -->
-									<text v-if="vuex_member_info.priceType>1" class="original-price gray line-through">¥ {{item.salePrice}}</text>
-									<!-- <text class="sales gray">销量999+</text> -->
-								</view>
+								<text class="red" style="font-size: 24rpx;">供货价</text>
+								<text class="price">¥ <text class="price-num">{{item.patchPrice}}</text></text>
 							</view>
 							<u-number-box 
 								v-model="item.quantity" 
@@ -62,7 +50,7 @@
 			</mescroll-body>
 			
         </view>
-		<view class="recommend" v-if="dataList.length>=total">
+	<!-- 	<view class="recommend" v-if="dataList.length>=total">
 			<view class="til u-flex">
 				<u-icon name="heart" color="#FF3C3F" size="28"></u-icon>
 				<text class="text">为你推荐</text>
@@ -81,7 +69,7 @@
 					</view>
 				</view>
 			</view>
-		</view>
+		</view> -->
 		<view class="cart-bottom">
 			<view class="inner u-flex u-row-between">
 				<view class="left u-flex">
@@ -94,8 +82,8 @@
 						合计:{{totalPrice}}
 					</view>
 				</view>
-				<view class="btn active" v-if="selectGoods.length>0&&cansubmit" @click="submitorder">去结算</view>
-				<view class="btn" v-else>去结算</view>
+				<view class="btn active" v-if="selectGoods.length>0&&cansubmit" @click="submitorder">提交</view>
+				<view class="btn" v-else>提交</view>
 			</view>
 		</view>
 		<u-toast ref="uToast"></u-toast>
@@ -108,6 +96,17 @@
 		mixins: [MescrollMixin,systemInfo], // 使用mixin
         data() {
             return {
+				downOption: {},
+				// 上拉加载的配置(可选, 绝大部分情况无需配置)
+				upOption: {
+					page: {
+						size: 10 // 每页数据的数量,默认10
+					},
+					noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+					empty: {
+						tip: '暂无相关数据'
+					}
+				},
 				cansubmit:true,
 				hasAddr:false,
 				buyNowId:null,//立即购买id
@@ -157,11 +156,7 @@
 			  return this.dataList.reduce((total, item) => {
 				if (item.checked) {
 					let price = null;
-					if(that.vuex_member_info.priceType>1){
-						price = item.vipPrice
-					}else{
-						price = item.salePrice
-					}
+					price = item.patchPrice
 				  total += price * item.quantity;
 				}
 				return total;
@@ -174,7 +169,7 @@
 			this.buyNowName = page.buyNowName;
 		},
 		onShow() {
-			this.getAddrList();
+			// this.getAddrList();
 		},
         methods: {
 			/*下拉刷新的回调, 重置列表为第一页 (此处可删,mixins已默认)
@@ -253,9 +248,10 @@
 				console.log('allCheckboxChange',n);
 				let selectAll = n[0]?true:false;
 				this.dataList.forEach(item => {
-					if(item.quantity<=item.stock){
-						item.checked = selectAll
-					}
+					item.checked = selectAll
+					// if(item.quantity<=item.stock){
+					// 	item.checked = selectAll
+					// }
 				})
 			},
 			checkboxChange(n){
@@ -271,7 +267,7 @@
 				this.changeQuantityApi(this.dataList[index].id,value.value,index)
             },
 			changeQuantityApi(id,num,index){
-				this.$u.api.updateQuantity({id:id,quantity:num}).then(res=>{
+				this.$u.api.updateQuantity({cartId:id,num:num,type:0}).then(res=>{
 					this.dataList[index].quantity = num;
 					console.log('res',res.data);
 					}).catch(err=>{
@@ -312,43 +308,18 @@
 				// console.log('submitorder',this.selectGoods);
 				this.cansubmit = false;
 				let param = {};
-				if(!this.hasAddr){
-					// this.$refs.uToast.show({
-					// 	type: 'error',
-					// 	title: '提示',
-					// 	message: "请先去'我的-地址管理'设置收货地址!",
-					// 	duration:3000
-					// })
-					uni.showModal({
-						title: '温馨提示',
-						content: '请先设置地址!',
-						success: res => {
-							if (res.confirm) {
-								uni.$u.route('/center/addrlist', {
-									from: 'cart',
-									backUrl:'/shopping/cart'
-								});
-							}
-						}
-					})
-					return
-				}
 				param.goodsList = this.selectGoods.map(item=>{
 					return {goodsId:item.goodsId,quantity:item.quantity}
 				})
-				this.$u.vuex('cartGoods', param.goodsList);
-				uni.$u.route('/shopping/submitorder', {});
-				this.cansubmit = true;
-				// // console.log('param',param);取消在这个获取订单结算详情
-				// this.$u.api.getSettlement(param).then(res=>{
-				// 	console.log('submitorder',res.data);
-				// 	// return
-				// 	uni.$u.route('/shopping/submitorder', {
-				// 		selectGoods: JSON.stringify(res.data),
-				// 	});
-				// }).catch(err=>{
-				// 	console.log('getSettlement',err.data);
-				// })
+				param.ifCartSubmint = true;
+				
+				this.$u.api.submitOrder(param).then(res=>{
+					uni.$u.route('/shopping/paysuccess');
+					this.cansubmit = true;
+				}).catch(err=>{
+					console.log('getAddrList',err.data);
+				});
+				
 			},
 			delSelect(){
 				let that = this;
@@ -408,7 +379,7 @@
 	.til{
 		position: sticky;
 		background-color: #fff;
-		z-index: 1001;
+		z-index: 999;
 		padding-bottom: 10rpx;
 		margin-bottom: 20rpx;
 		min-height: 30px;

+ 7 - 6
shopping/paysuccess.vue

@@ -4,7 +4,7 @@
 			<u-icon name="checkmark" color="#fff" size="80"></u-icon>
 		</view>
 		<view class="title">{{title}}</view>
-		<view class="full-btn" @click="btnClick">完成</view>
+		<view class="full-btn" @click="btnClick">继续选品</view>
 	</view>
 </template>
 
@@ -13,7 +13,7 @@
 		data() {
 			return {
 				fromPage:'',
-				title:'付款成功'
+				title:'提交成功!工作人员将在24小时内与您联系,请耐心等待'
 			}
 		},
 		onShow() {		
@@ -26,7 +26,7 @@
 		},
 		methods: {
 			btnClick(){
-				uni.reLaunch({url: '/pages/index/index'});
+				uni.reLaunch({url: '/shopping/producTypetList'});
 			}
 		}
 	}
@@ -50,10 +50,11 @@
 	border-radius: 50%;
 }
 .title{
-	font-size: 32rpx;
-	font-weight: 600;
+	font-size: 26rpx;
+	font-family: PingFangSC-Regular, PingFang SC;
+	font-weight: 400;
 	color: #333333;
-	line-height: 40rpx;
+	line-height: 37rpx;
 	margin-bottom: 120rpx;
 }
 .full-btn{

+ 11 - 11
shopping/producTypetList.vue

@@ -3,7 +3,8 @@
 		<u-navbar
 			:placeholder="true"
 			title="产品"
-			:autoBack="true"
+			:autoBack="false"
+			@leftClick="leftClick"
 			 :safeAreaInsetTop="true"
 		>
 		</u-navbar>
@@ -66,18 +67,12 @@
 									<view class="u-flex u-row-between">
 										<view class="left">
 											<view class="up">
-												<view class="" v-if="vuex_member_info.priceType>1">
-													<text class="price">¥ <text class="price-num">{{item.vipPrice}}</text></text>
-													<text class="vip-icon">VIP</text>
-												</view>
-												<view class="" v-else>
-													<text class="price">¥ <text class="price-num">{{item.salePrice}}</text></text>
+												<view class="">
+													<text class="price">¥ <text class="price-num">{{item.patchPrice}}</text></text>
 												</view>
 											</view>
 											<view class="down">
-												<!-- <text class="discount">8.8折</text> -->
-												<text v-if="vuex_member_info.priceType>1" class="original-price gray line-through">¥ {{item.salePrice}}</text>
-												<text class="sales gray">销量 {{item.saleCount}}</text>
+												<text class="original-price gray line-through">¥ {{item.salePrice}}</text>
 											</view>
 										</view>
 										<u--image :showLoading="false" @click.native.stop="addCart(item.id)" :src="staticUrl+'/img/add.png'" width="48rpx" height="48rpx"></u--image>
@@ -90,7 +85,7 @@
 			</view>
 		</view>
 		<!-- <tabbar :tabbarIndexProps="Number(1)" /> -->
-		<!-- <cartfixed ref="cartfixed" @getCartList="getCartList" /> -->
+		<cartfixed ref="cartfixed" @getCartList="getCartList" />
 		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
@@ -159,6 +154,11 @@
 			// this.$refs.cartfixed.getCartList();
 		},
 		methods: {
+			leftClick(){
+				uni.reLaunch({
+					url:'/pages/index/index'
+				})
+			},
 			/*下拉刷新的回调, 重置列表为第一页 (此处可删,mixins已默认)
 			downCallback(){
 				this.mescroll.resetUpScroll();

+ 14 - 29
shopping/productdetails.vue

@@ -36,34 +36,25 @@
 					<text class="exchangeCredit" v-if="details.isCredit==1">+{{details.exchangeCredit}}积分</text>
 				</view>
 			</view>
-			<view class="u-flex u-row-between gray">
+			<!-- <view class="u-flex u-row-between gray">
 				<text v-if="vuex_member_info.priceType>1" class="line-through">¥ <text class="">{{details.salePrice}}</text></text>
 				<text class="">库存 {{details.stock}}</text>
-			</view>
+			</view> -->
 			<view class="name">{{details.goodsName}}</view>
 		</view>
 		<view class="specification info-line u-flex view-wrap" v-if="details.specification">
 			<view class="info-til">规格</view>
 			<view class="info-con u-flex">{{details.specification}}</view>
 		</view>
-		<view class="addr view-wrap">
+		<!-- <view class="addr view-wrap">
 			<view class="addr-line u-flex">
 				<view class="info-til">快递</view>
 				<view class="info-con u-flex">
 					包邮
 				</view>
 			</view>
-			<!-- <view class="addr-line u-flex">
-				<text class="addr-til">送至</text>
-				<view class="addr-con u-flex u-flex-1">
-					<view class="u-flex u-row-between u-flex-1">
-						<text>贵阳市 南明区</text>
-						<u-icon name="arrow-right" color="#676767" size="20"></u-icon>
-					</view>
-				</view>
-			</view> -->
-		</view>
-		<view class="comment view-wrap u-flex u-row-between">
+		</view> -->
+	<!-- 	<view class="comment view-wrap u-flex u-row-between">
 			<view class="left">
 				<text class="til">评价</text>
 				<text class="num">({{details.commentNum}})</text>
@@ -72,7 +63,7 @@
 				<text>查看全部</text>
 				<u-icon name="arrow-right" color="#676767" size="20"></u-icon>
 			</view>
-		</view>
+		</view> -->
 		<view class="detail view-wrap">
 			<view class="til">详情</view>
 			<view class="con">
@@ -84,29 +75,23 @@
 		<view class="details-tool-wrap">
 			<view class="details-tool u-flex u-row-between">
 				<view class="left u-flex">
-					<view class="icon-wrap">
+					<!-- <view class="icon-wrap">
 						<button class="share-btn" data-name="shareBtn" open-type="share">
 							<u-icon name="share" color="#676767" size="30"></u-icon>
 							分享
 						</button>
-					</view>
-					<view class="icon-wrap" v-if="details.isCredit!=1"  @click="$u.route('/shopping/cart')">
+					</view> -->
+				<!-- 	<view class="icon-wrap" v-if="details.isCredit!=1"  @click="$u.route('/shopping/cart')">
 						<u-icon name="shopping-cart" color="#676767" size="30"></u-icon>
 						购物车
 						<u-badge class="badge" numberType="overflow" type="error " max="99" :value="cartTotal" :absolute="true" :offset="[0,0]"></u-badge>
-					</view>
+					</view> -->
 				</view>
-				<view class="right" v-if="details.stock>0">
-					<view class="u-flex" v-if="details.isCredit==1">
-						<view class="btn add-btn" @click="addCreditOrder(details.id)">立即兑换</view>
+				<view class="right">
+					<view class="u-flex">
+						<view class="btn add-btn" @click="addCart(details.id)">添加</view>
+						<!-- <view class="btn buy-btn" @click="buyNow(details.id)">立即购买</view> -->
 					</view>
-					<view class=" u-flex" v-else>
-						<view class="btn add-btn" @click="addCart(details.id)">加入购物车</view>
-						<view class="btn buy-btn" @click="buyNow(details.id)">立即购买</view>
-					</view>
-				</view>
-				<view class="right" v-else>
-					<view class="btn gray">暂无库存</view>
 				</view>
 				
 			</view>

BIN
static/img/empty.png


BIN
static/img/index-nav-1.png


BIN
static/img/index-nav-2.png


BIN
static/img/index-nav-3.png


BIN
static/img/index-nav-4.png


BIN
static/img/index-nav-5.png


+ 5 - 1
uni.scss

@@ -204,7 +204,11 @@ page{
 		.original-price{
 			
 		}
-		.sales{margin-left: 30rpx;}
+		.sales{
+			&:not(:first-of-type){
+				margin-left: 30rpx;
+			}
+		}
 		.discount{
 			padding: 4rpx 14rpx;
 			border: 1px solid #FF3C3F;

+ 25 - 0
utils/downloadImage.js

@@ -0,0 +1,25 @@
+export function downloadImage(url, filename) {
+  // 创建XMLHttpRequest对象
+  var xhr = new XMLHttpRequest();
+  xhr.open('GET', url, true);
+  xhr.responseType = 'blob';
+
+  // 读取图片数据并创建Blob
+  xhr.onload = function() {
+    if (xhr.status === 200) {
+      var blob = new Blob([xhr.response], { type: 'image/jpeg' });
+
+      // 创建URL对象并模拟点击下载链接
+      var url = window.URL.createObjectURL(blob);
+      var a = document.createElement('a');
+      a.href = url;
+      a.download = filename;
+      document.body.appendChild(a);
+      a.click();
+      document.body.removeChild(a);
+    }
+  };
+
+  // 发送请求
+  xhr.send();
+}