lhl 2 년 전
부모
커밋
c58c16c263
31개의 변경된 파일217개의 추가작업 그리고 7개의 파일을 삭제
  1. 18 0
      api/shop.js
  2. 1 1
      components/lee-select-city/city.json
  3. 2 2
      components/lee-select-city/hot-cities.json
  4. 8 1
      main.js
  5. 133 0
      pages/order/order.vue
  6. 51 1
      pages/user/user.vue
  7. BIN
      unpackage/dist/build/h5/6-2-4.rar
  8. 1 1
      unpackage/dist/build/h5/index.html
  9. 0 0
      unpackage/dist/build/h5/static/js/index.a52d1661.js
  10. 0 0
      unpackage/dist/build/h5/static/js/index.c81cb096.js
  11. 0 0
      unpackage/dist/build/h5/static/js/pages-index-index.7247a8ae.js
  12. 0 0
      unpackage/dist/build/h5/static/js/pages-index-index~pages-index-selectCity.4626df8d.js
  13. 0 0
      unpackage/dist/build/h5/static/js/pages-index-index~pages-index-selectCity.91909006.js
  14. 0 0
      unpackage/dist/build/h5/static/js/pages-order-order.1ce31815.js
  15. 0 0
      unpackage/dist/build/h5/static/js/pages-order-order.e7866774.js
  16. 0 0
      unpackage/dist/build/h5/static/js/pages-order-order~pages-user-user.ebc505d8.js
  17. 0 0
      unpackage/dist/build/h5/static/js/pages-shop-djqQm.960f9888.js
  18. 0 0
      unpackage/dist/build/h5/static/js/pages-shop-shareF.e16f7514.js
  19. 0 0
      unpackage/dist/build/h5/static/js/pages-shop-shopDetail.127d08b1.js
  20. 0 0
      unpackage/dist/build/h5/static/js/pages-shop-shopList.632dc6cf.js
  21. 0 0
      unpackage/dist/build/h5/static/js/pages-user-user.2e073871.js
  22. 0 0
      unpackage/dist/build/h5/static/js/pages-user-user.e5948ff1.js
  23. 0 0
      unpackage/dist/build/mp-weixin/common/main.js
  24. 0 0
      unpackage/dist/build/mp-weixin/common/vendor.js
  25. 0 0
      unpackage/dist/build/mp-weixin/pages/order/order.js
  26. 1 0
      unpackage/dist/build/mp-weixin/pages/order/order.json
  27. 0 0
      unpackage/dist/build/mp-weixin/pages/order/order.wxml
  28. 0 0
      unpackage/dist/build/mp-weixin/pages/order/order.wxss
  29. 0 0
      unpackage/dist/build/mp-weixin/pages/user/user.js
  30. 0 0
      unpackage/dist/build/mp-weixin/pages/user/user.wxml
  31. 2 1
      unpackage/dist/build/mp-weixin/project.config.json

+ 18 - 0
api/shop.js

@@ -51,4 +51,22 @@ export function getCity(data) {
 		method: 'get',
 		data
 	})
+}
+
+//兑换
+export function goDh(data) {
+	return request({
+		url: '/api/exchange',
+		method: 'post',
+		data
+	})
 }
+
+//转赠
+export function gozz(data) {
+	return request({
+		url: '/api/donation',
+		method: 'post',
+		data
+	})
+}

+ 1 - 1
components/lee-select-city/city.json

@@ -3511,7 +3511,7 @@
 		"latter": "H"
 	},
 	{
-		"name": "上海",
+		"name": "上海",
 		"latter": "S",
 		"children": [
 			{

+ 2 - 2
components/lee-select-city/hot-cities.json

@@ -1,6 +1,6 @@
-[
+[["台州",["浙江省","台州市"]],
 	["北京", ["北京市"]],
-	["上海", ["上海"]],
+	["上海", ["上海"]],
 	["广州", ["广东省", "广州市"]],
 	["深圳", ["广东省", "深圳市"]],
 	["杭州", ["浙江省", "杭州市"]],

+ 8 - 1
main.js

@@ -20,6 +20,13 @@ const msg = (title, duration=1500, mask=false, icon='none')=>{
 		mask,
 		icon
 	});
+}
+
+const showOk = (title) => {
+	uni.showToast({
+		title: title,
+		duration: 2000
+	});
 }
 
 const prePage = ()=>{
@@ -36,7 +43,7 @@ const prePage = ()=>{
 Vue.config.productionTip = false
 Vue.prototype.$fire = new Vue();
 Vue.prototype.$store = store;
-Vue.prototype.$api = {msg, prePage};
+Vue.prototype.$api = {msg, prePage,showOk};
 
 App.mpType = 'app'
 

+ 133 - 0
pages/order/order.vue

@@ -57,6 +57,8 @@
 								class="action-btn recom">立即支付</button>
 							<button v-if="item._status._title == '待评价'" class="action-btn"
 								@click.stop="sy(item)">使用</button>
+							<button v-if="tabCurrentIndex == 1" class="action-btn"
+									@click.stop="openDh(item)">转赠</button>
 							<button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)"
 								class="action-btn">确认收货</button>
 							<!-- 							<button v-if="item._status._title == '未发货' && item.is_gift != 1" class="action-btn"
@@ -68,12 +70,29 @@
 				</scroll-view>
 			</swiper-item>
 		</swiper>
+		<uni-popup ref="popupdh" class="agree-wrapper">
+			<view class="hx-wrapper">
+				<view class="hx-img">
+					<image src="../../static/img/hxbg.png" mode=""></image>
+				</view>
+				<view class="hx-body">
+					<view class="hx-title">赠送好友</view>
+					<input type="text" v-model="zzuid" placeholder="请输入好友UID" placeholder-class="hx-placeholder" />
+					<view class="hx-btn" @click.stop="gozz()">立即赠送</view>
+				</view>
+				<view class="hx-close" @click="closeDh()">
+					<image src="../../static/icon/close.png" mode=""></image>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
 <script>
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 	import empty from '@/components/empty';
+	
+	import { gozz } from '@/api/shop.js'
 	import {
 		orderList,
 		orderCancel,
@@ -92,6 +111,10 @@
 		},
 		data() {
 			return {
+				zzitem: {},
+				zzuid: '',
+				zzcode: '',
+				dhing: false,
 				tabCurrentIndex: 0,
 				navList: [{
 						state: 0,
@@ -218,6 +241,42 @@
 		},
 		// #endif
 		methods: {
+			// 打开兑换弹窗
+			openDh(item) {
+				this.zzitem = item
+				this.zzcode = item.order_id
+				this.$refs.popupdh.open()
+			},
+			// 关闭兑换弹窗
+			closeDh() {
+				this.zzcode = ''
+				this.zzuid = ''
+				this.$refs.popupdh.close()
+			},
+			// 兑换
+			gozz() {
+				let obj = this
+				if (obj.dhing) {
+					return
+				}
+				if (obj.zzuid == '') {
+					return obj.$api.msg('请输入接收人UID')
+				}
+				obj.dhing = true
+				gozz({
+					order_id: obj.zzcode,
+					uid: obj.zzuid
+				}).then(res => {
+					
+					let s = this.navList[obj.tabCurrentIndex].orderList.indexOf(obj.zzitem);
+					this.navList[obj.tabCurrentIndex].orderList.splice(s, 1);
+					obj.dhing = false
+					obj.closeDh()
+					obj.$api.showOk('赠送成功')
+				}).catch(err => {
+					obj.dhing = false
+				})
+			},
 			sy(e) {
 				console.log(e);
 				uni.navigateTo({
@@ -788,4 +847,78 @@
 			opacity: 0.2;
 		}
 	}
+	.hx-wrapper {
+		width: 536rpx;
+		height: 630rpx;
+		position: relative;
+	
+		// background-color: #fff;
+		.hx-img {
+			width: 536rpx;
+			height: 281rpx;
+	
+			image {
+				width: 536rpx;
+				height: 281rpx;
+			}
+		}
+	
+		.hx-close {
+			position: absolute;
+			left: 243rpx;
+			bottom: -80rpx;
+			width: 52rpx;
+			height: 52rpx;
+	
+			image {
+				width: 52rpx;
+				height: 52rpx;
+			}
+		}
+	
+		.hx-body {
+			width: 536rpx;
+			height: 349rpx;
+			background-color: #fff;
+			border-radius: 0 0 10rpx 10rpx;
+	
+			.hx-title {
+				width: 536rpx;
+				font-size: 36rpx;
+				font-weight: 500;
+				color: #333333;
+				line-height: 1;
+				padding-top: 42rpx;
+				text-align: center;
+			}
+	
+			input {
+				width: 439rpx;
+				height: 68rpx;
+				background: #dbf3e9;
+				border-radius: 10rpx;
+				margin: 39rpx auto 0;
+				padding-left: 26rpx;
+	
+				.hx-placeholder {
+					font-size: 26rpx;
+					font-weight: 500;
+					color: #52c696;
+				}
+			}
+	
+			.hx-btn {
+				margin: 44rpx auto 0;
+				width: 353rpx;
+				height: 71rpx;
+				background: #52c696;
+				border-radius: 34rpx;
+				font-size: 36rpx;
+				font-weight: 500;
+				color: #f8f9f9;
+				line-height: 71rpx;
+				text-align: center;
+			}
+		}
+	}
 </style>

+ 51 - 1
pages/user/user.vue

@@ -54,7 +54,8 @@
 				thumb="/static/user/user2.png"></uni-list-item>
 			<uni-list-item title="我的优惠券" @click="navTo('/pages/user/myyhq')" thumb="/static/icon/g-l.png">
 			</uni-list-item>
-
+			<uni-list-item title="兑换码兑换" @click="openDh" thumb="/static/user/mybank.png" v-if="userInfo.uid">
+			</uni-list-item>
 			<uni-list-item title="邀请有礼" @click="navTo('/pages/user/shareQrCode')" thumb="/static/user/user3.png"
 				v-if="userInfo.level">
 			</uni-list-item>
@@ -100,9 +101,27 @@
 				</view>
 			</view>
 		</uni-popup>
+		<uni-popup ref="popupdh" class="agree-wrapper">
+			<view class="hx-wrapper">
+				<view class="hx-img">
+					<image src="../../static/img/hxbg.png" mode=""></image>
+				</view>
+				<view class="hx-body">
+					<view class="hx-title">输入礼包兑换码</view>
+					<input type="text" v-model="dhcode" placeholder="请输入兑换码" placeholder-class="hx-placeholder" />
+					<view class="hx-btn" @click.stop="goDh()">立即兑换</view>
+				</view>
+				<view class="hx-close" @click="closeDh()">
+					<image src="../../static/icon/close.png" mode=""></image>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 <script>
+	import {
+		goDh
+	} from '@/api/shop.js'
 	import {
 		tabbar1
 	} from '@/utils/tabbar.js';
@@ -137,6 +156,8 @@
 		},
 		data() {
 			return {
+				dhcode: '', //兑换码
+				dhing: false, //是否兑换中
 				code: '',
 				current: 4,
 				tabbar: tabbar1,
@@ -249,6 +270,35 @@
 		},
 		methods: {
 			...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
+			// 打开兑换弹窗
+			openDh() {
+				this.$refs.popupdh.open()
+			},
+			// 关闭兑换弹窗
+			closeDh() {
+				this.dhcode = ''
+				this.$refs.popupdh.close()
+			},
+			// 兑换
+			goDh() {
+				let obj = this
+				if (obj.dhing) {
+					return
+				}
+				if (obj.dhcode == '') {
+					return obj.$api.msg('请输入兑换码')
+				}
+				obj.dhing = true
+				goDh({
+					code: obj.dhcode
+				}).then(res => {
+					obj.dhing = false
+					obj.closeDh()
+					obj.$api.showOk('兑换成功')
+				}).catch(err => {
+					obj.dhing = false
+				})
+			},
 			shareLL() {
 				this.$api.msg('功能建设中,敬请期待');
 			},

BIN
unpackage/dist/build/h5/6-1-3.rar → unpackage/dist/build/h5/6-2-4.rar


+ 1 - 1
unpackage/dist/build/h5/index.html

@@ -1,2 +1,2 @@
 <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>想亮商城</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
-            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/index/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/index/static/js/chunk-vendors.58012eb0.js></script><script src=/index/static/js/index.c81cb096.js></script></body></html>
+            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/index/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/index/static/js/chunk-vendors.58012eb0.js></script><script src=/index/static/js/index.a52d1661.js></script></body></html>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/index.a52d1661.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/index.c81cb096.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-index-index.7247a8ae.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-index-index~pages-index-selectCity.4626df8d.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-index-index~pages-index-selectCity.91909006.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-order-order.1ce31815.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-order-order.e7866774.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-order-order~pages-user-user.ebc505d8.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-shop-djqQm.960f9888.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-shop-shareF.e16f7514.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-shop-shopDetail.127d08b1.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-shop-shopList.632dc6cf.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-user-user.2e073871.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-user-user.e5948ff1.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/mp-weixin/common/main.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/mp-weixin/common/vendor.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/mp-weixin/pages/order/order.js


+ 1 - 0
unpackage/dist/build/mp-weixin/pages/order/order.json

@@ -2,6 +2,7 @@
   "navigationBarTitleText": "我的订单",
   "usingComponents": {
     "uni-load-more": "/components/uni-load-more/uni-load-more",
+    "uni-popup": "/components/uni-popup/uni-popup",
     "empty": "/components/empty"
   }
 }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/mp-weixin/pages/order/order.wxml


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/mp-weixin/pages/order/order.wxss


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/mp-weixin/pages/user/user.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
unpackage/dist/build/mp-weixin/pages/user/user.wxml


+ 2 - 1
unpackage/dist/build/mp-weixin/project.config.json

@@ -31,7 +31,8 @@
             "outputPath": ""
         },
         "disableUseStrict": false,
-        "useCompilerPlugins": false
+        "useCompilerPlugins": false,
+        "minifyWXML": true
     },
     "compileType": "miniprogram",
     "libVersion": "2.24.4",

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.