diff --git a/apis/interfaces/coupon.js b/apis/interfaces/coupon.js new file mode 100644 index 0000000..2520e5a --- /dev/null +++ b/apis/interfaces/coupon.js @@ -0,0 +1,83 @@ +/** + * Web-zdx + * moduleName: 优惠券相关 + */ + +import request from '../request.js' + +// 我的优惠券 +const myCoupon = (data) => { + return request({ + url: 'coupons/user/coupons', + method: 'get', + data: data + }) +} + +// 优惠券分组列表 +const getCouponsListById = (id,data) => { + return request({ + url: 'coupons/user/coupons/'+id+'/list', + data:data + }) +} + +// 根据优惠券id获取优惠券的详情信息 +const getCouponsInfoById = (id) => { + return request({ + url: 'coupons/user/coupons/'+id, + }) +} + + +// 根据企业id获取企业首页的轮播图列表 +const couponsByCompanyId = (data) => { + return request({ + url: 'coupons', + method: 'get', + data: data + }) +} + +// 领取优惠券 +const couponsGrant = (id) => { + return request({ + url: 'coupons/'+id+'/grant', + method: 'POST' + }) +} +// 获取优惠券可使用商品 +const getGoodsByGrantId = (data) => { + return request({ + url: 'user/coupons/goods', + data: data + }) +} + +// 使用提货券兑换商品 +const exchangeGoods = (data) => { + return request({ + url: 'user/coupons/exchange', + method: 'POST', + data: data + }) +} + +// 获取核销二维码 +const getQrcodeByGrantId = (data) => { + return request({ + url: 'coupons/user/coupons/qrcode', + data: data + }) +} + +export { + myCoupon, + couponsByCompanyId, + couponsGrant, + getGoodsByGrantId, + exchangeGoods, + getCouponsListById, + getCouponsInfoById, + getQrcodeByGrantId +} diff --git a/components/coupon-template/coupon-template-1.vue b/components/coupon-template/coupon-template-1.vue new file mode 100644 index 0000000..b08367f --- /dev/null +++ b/components/coupon-template/coupon-template-1.vue @@ -0,0 +1,240 @@ + + + + + diff --git a/components/goods-template/goods-template.vue b/components/goods-template/goods-template.vue new file mode 100644 index 0000000..c9cf843 --- /dev/null +++ b/components/goods-template/goods-template.vue @@ -0,0 +1,173 @@ + + + + + diff --git a/pages.json b/pages.json index c4bb810..3f89bcc 100644 --- a/pages.json +++ b/pages.json @@ -71,7 +71,7 @@ "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#e93340" } - },{ + }, { "path": "pages/property/order/mallShipments", "name": "MallShipments", "style": { @@ -79,7 +79,7 @@ "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#e93340" } - },{ + }, { "path": "pages/property/order/logistics", "name": "Orderlogistics", "style": { @@ -87,7 +87,7 @@ "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#e93340" } - },{ + }, { "path": "pages/property/order/mallShipmentsInfo", "name": "MallShipmentsInfo", "style": { @@ -95,7 +95,7 @@ "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#e93340" } - },{ + }, { "path": "pages/property/order/mallRefundsInfo", "name": "MallRefundsInfo", "style": { @@ -103,7 +103,7 @@ "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#e93340" } - },{ + }, { "path": "pages/property/order/mallShipmentsRefund", "name": "MallShipmentsRefund", "style": { @@ -112,6 +112,34 @@ "navigationBarBackgroundColor": "#e93340" } }, + { + "path": "pages/property/coupon/coupon", + "name": "CouponList", + "style": { + "enablePullDownRefresh": true, + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#e93340", + "navigationBarTitleText": "我的优惠券" + } + }, { + "path": "pages/property/coupon/couponMore", + "name": "CouponMoreList", + "style": { + "enablePullDownRefresh": true, + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#e93340", + "navigationBarTitleText": "优惠券列表" + } + }, { + "path": "pages/property/coupon/detail", + "name": "CouponDetail", + "style": { + "enablePullDownRefresh": true, + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#e93340", + "navigationBarTitleText": "优惠券详情" + } + }, { "path": "pages/goods/details", "name": "goodsDetails", diff --git a/pages/property/coupon/coupon.vue b/pages/property/coupon/coupon.vue new file mode 100644 index 0000000..f2cf61a --- /dev/null +++ b/pages/property/coupon/coupon.vue @@ -0,0 +1,292 @@ + + + + + diff --git a/pages/property/coupon/couponMore.vue b/pages/property/coupon/couponMore.vue new file mode 100644 index 0000000..286ebe2 --- /dev/null +++ b/pages/property/coupon/couponMore.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/pages/property/coupon/detail.vue b/pages/property/coupon/detail.vue new file mode 100644 index 0000000..946afd8 --- /dev/null +++ b/pages/property/coupon/detail.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/pages/property/coupon/index.vue b/pages/property/coupon/index.vue new file mode 100644 index 0000000..9815da1 --- /dev/null +++ b/pages/property/coupon/index.vue @@ -0,0 +1,885 @@ + + + + + diff --git a/pages/property/index.vue b/pages/property/index.vue index 129da85..7c3c545 100644 --- a/pages/property/index.vue +++ b/pages/property/index.vue @@ -91,7 +91,7 @@ 关注企业 - + 我的优惠券 diff --git a/pages/property/order/mallRefund.vue b/pages/property/order/mallRefund.vue index d3ea316..654ef8c 100644 --- a/pages/property/order/mallRefund.vue +++ b/pages/property/order/mallRefund.vue @@ -205,7 +205,7 @@ // 查看详情 goDetail(no){ - this.$Router.push({ + this.$router.push({ name: 'MallRefundsInfo', params:{ no:no diff --git a/pages/property/order/mallShipments.vue b/pages/property/order/mallShipments.vue index 818b807..de7e733 100644 --- a/pages/property/order/mallShipments.vue +++ b/pages/property/order/mallShipments.vue @@ -313,7 +313,7 @@ // 申请退货 nowRefund(no) { - this.$Router.push({ + this.$router.push({ name: 'MallShipmentsRefund', params: { no: no @@ -322,7 +322,7 @@ }, // 查看物流 nowLogistics(no) { - this.$Router.push({ + this.$router.push({ name: 'Orderlogistics', params: { no: no @@ -331,7 +331,7 @@ }, // 查看详情 goDetail(no) { - this.$Router.push({ + this.$router.push({ name: 'MallShipmentsInfo', params: { no: no @@ -341,7 +341,7 @@ // 查看退货单详情 // 查看详情 goDetail1(no){ - this.$Router.push({ + this.$router.push({ name: 'MallRefundsInfo', params:{ no:no diff --git a/pages/property/order/mallShipmentsInfo.vue b/pages/property/order/mallShipmentsInfo.vue index a7fbf2d..e90e231 100644 --- a/pages/property/order/mallShipmentsInfo.vue +++ b/pages/property/order/mallShipmentsInfo.vue @@ -211,7 +211,7 @@ }, // 申请退货 nowRefund(no){ - this.$Router.push({ + this.$router.push({ name: 'MallShipmentsRefund', params:{ no:no diff --git a/static/images/coupon-bg-1.png b/static/images/coupon-bg-1.png new file mode 100644 index 0000000..7ff50ba Binary files /dev/null and b/static/images/coupon-bg-1.png differ diff --git a/static/images/coupon-bg-2.png b/static/images/coupon-bg-2.png new file mode 100644 index 0000000..6a253f7 Binary files /dev/null and b/static/images/coupon-bg-2.png differ diff --git a/static/images/coupon-bg.png b/static/images/coupon-bg.png new file mode 100644 index 0000000..0455c90 Binary files /dev/null and b/static/images/coupon-bg.png differ diff --git a/static/images/coupon-fu.png b/static/images/coupon-fu.png new file mode 100644 index 0000000..76be753 Binary files /dev/null and b/static/images/coupon-fu.png differ diff --git a/static/images/coupon-img-2.png b/static/images/coupon-img-2.png new file mode 100644 index 0000000..2fe77cb Binary files /dev/null and b/static/images/coupon-img-2.png differ diff --git a/static/images/coupon-img-3.png b/static/images/coupon-img-3.png new file mode 100644 index 0000000..bc43fb6 Binary files /dev/null and b/static/images/coupon-img-3.png differ diff --git a/static/images/coupon-img.png b/static/images/coupon-img.png new file mode 100644 index 0000000..b1d3b43 Binary files /dev/null and b/static/images/coupon-img.png differ diff --git a/static/images/coupon-quan.png b/static/images/coupon-quan.png new file mode 100644 index 0000000..593f357 Binary files /dev/null and b/static/images/coupon-quan.png differ diff --git a/static/images/coupon-ti.png b/static/images/coupon-ti.png new file mode 100644 index 0000000..6aec5ca Binary files /dev/null and b/static/images/coupon-ti.png differ diff --git a/static/images/coupons-banner-bg.png b/static/images/coupons-banner-bg.png new file mode 100644 index 0000000..a4ce3b8 Binary files /dev/null and b/static/images/coupons-banner-bg.png differ diff --git a/static/images/has_get.png b/static/images/has_get.png new file mode 100644 index 0000000..a304646 Binary files /dev/null and b/static/images/has_get.png differ diff --git a/static/images/has_un_used.png b/static/images/has_un_used.png new file mode 100644 index 0000000..14bf097 Binary files /dev/null and b/static/images/has_un_used.png differ diff --git a/static/images/has_used.png b/static/images/has_used.png new file mode 100644 index 0000000..49a73c4 Binary files /dev/null and b/static/images/has_used.png differ diff --git a/uniCloud-aliyun/cloudfunctions/phone-login/index.js b/uniCloud-aliyun/cloudfunctions/phone-login/index.js deleted file mode 100644 index caa1420..0000000 --- a/uniCloud-aliyun/cloudfunctions/phone-login/index.js +++ /dev/null @@ -1,37 +0,0 @@ - -'use strict'; - -const crypto = require('crypto') - -exports.main = async (event) => { - const secret = 'Yuzhankeji2021.' - const hmac = crypto.createHmac('sha256', secret); - - let params = event.queryStringParameters - const sign = params.sign - delete params.sign - - const signStr = Object.keys(params).sort().map(key => { - return `${key}=${params[key]}` - }).join('&') - - hmac.update(signStr); - - if (sign !== hmac.digest('hex')) { - throw new Error('非法访问') - } - - const { - access_token, - openid - } = params - - return await uniCloud.getPhoneNumber({ - appid: '__UNI__CD19AAD', - provider: 'univerify', - apiKey: '16fa20236696596869759d3a81541901', - apiSecret: 'fca97287360c2e8f8259d8877a601887', - access_token: access_token, - openid: openid, - }) -};