diff --git a/README.md b/README.md index a98b9273..90abcece 100644 --- a/README.md +++ b/README.md @@ -19,18 +19,19 @@ JAVA版商城系统是基于Java(SpringBoot) + Vue(Element UI) + UniApp开发的 网络营销的一款企业应用,更适合企业二次开发。 ~~~~ - -![](https://gitee.com/stivepeim/img4mk/raw/master/20210205091003.png) +![](https://gitee.com/stivepeim/img4mk/raw/master/20210611144457.png) ## 导航栏目 - [![帮助手册](https://img.shields.io/badge/%E5%B8%AE%E5%8A%A9%E6%89%8B%E5%86%8C-Java%E5%B8%AE%E5%8A%A9%E6%89%8B%E5%86%8C-orange)](http://help.crmeb.net/crmeb_java/1748037t) + + + ### [帮助手册](https://help.crmeb.net/crmeb_java/1748037) [论坛地址](https://q.crmeb.net) [官网地址](https://www.crmeb.com) [服务器](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=dligum2z) [授权价格](http://crmeb.com/web/auth/apply) [GitHub地址](https://github.com/crmeb/crmeb_java) [码云地址](https://gitee.com/ZhongBangKeJi/crmeb_java) ## 预览 ![二维码预览](https://gitee.com/stivepeim/img4mk/raw/master/20210519104517.jpg) @@ -72,9 +73,12 @@ JAVA版商城系统是基于Java(SpringBoot) + Vue(Element UI) + UniApp开发的 ~~~ ## 移动端预览 -![](https://gitee.com/stivepeim/img4mk/raw/master/20210204184108.jpg) + +![](https://gitee.com/stivepeim/img4mk/raw/master/20210611145305.png) +![](https://gitee.com/stivepeim/img4mk/raw/master/20210611145407.png) +![](https://gitee.com/stivepeim/img4mk/raw/master/20210611145443.png) ## 功能图预览 ![项目基本功能介绍](https://gitee.com/stivepeim/img4mk/raw/master/20201225180349.jpeg) @@ -86,22 +90,6 @@ JAVA版商城系统是基于Java(SpringBoot) + Vue(Element UI) + UniApp开发的 ![复制第三方平台商品](https://gitee.com/stivepeim/img4mk/raw/master/20210202175224.png) ![营销功能](https://gitee.com/stivepeim/img4mk/raw/master/20210202175547.png) ![自定义表单组件](https://gitee.com/stivepeim/img4mk/raw/master/20210202175013.png) - - ## 项目源码 @@ -110,7 +98,7 @@ JAVA版商城系统是基于Java(SpringBoot) + Vue(Element UI) + UniApp开发的 |gitHub| https://github.com/crmeb/crmeb_java| |gitee|https://gitee.com/ZhongBangKeJi/crmeb_java| -![](https://gitee.com/stivepeim/img4mk/raw/master/20210205091002.jpeg) + ## 运行环境及框架 ~~~ diff --git a/admin/src/api/marketing.js b/admin/src/api/marketing.js index c6748f2b..4c27bbc0 100644 --- a/admin/src/api/marketing.js +++ b/admin/src/api/marketing.js @@ -12,6 +12,17 @@ export function marketingListApi(params) { }) } +/** + * 用户管理 优惠券列表 + * @param pram + */ +export function marketingSendApi(params) { + return request({ + url: '/admin/marketing/coupon/send/list', + method: 'get', + params + }) +} /** * 优惠券 详情 @@ -61,6 +72,18 @@ export function couponIssueStatusApi(params) { }) } +/** + * 优惠券 删除 + * @param pram + */ +export function couponDeleteApi(params) { + return request({ + url: '/admin/marketing/coupon/delete', + method: 'post', + params + }) +} + /** * 会员领取记录 列表 * @param pram @@ -79,7 +102,7 @@ export function couponUserListApi(params) { */ export function integralListApi(params, data) { return request({ - url: '/admin/user/bill/list', + url: '/admin/user/integral/list', method: 'post', params, data @@ -439,3 +462,109 @@ export function exportcombiantionApi(params) { params }) } + +/** + * 视频号 草稿列表 + */ +export function draftListApi(params) { + return request({ + url: `/admin/pay/component/product/draft/list`, + method: 'get', + params + }) +} + + +/** + * 视频号 商品列表 + */ +export function videoProductListApi(params) { + return request({ + url: `/admin/pay/component/product/list`, + method: 'get', + params + }) +} + +/** + * 视频号 类目 + */ +export function catListApi(params) { + return request({ + url: `/admin/pay/component/cat/get/list`, + method: 'get' + }) +} + +/** + * 视频号 添加 + */ +export function videoAddApi(data) { + return request({ + url: `/admin/pay/component/product/add`, + method: 'post', + data + }) +} + +/** + * 视频号 编辑 + */ +export function videoUpdateApi(data) { + return request({ + url: `/admin/pay/component/product/update`, + method: 'post', + data + }) +} + +/** + * 视频号 上架 + */ +export function videoUpApi(proId) { + return request({ + url: `/admin/pay/component/product/listing/${proId}`, + method: 'post' + }) +} + +/** + * 视频号 下架 + */ +export function videoDownApi(proId) { + return request({ + url: `/admin/pay/component/product/delisting/${proId}`, + method: 'post' + }) +} + +/** + * 视频号 删除 + */ +export function videoDelApi(proId) { + return request({ + url: `/admin/pay/component/product/delete/${proId}`, + method: 'post' + }) +} + +/** + * 视频号 草稿商品详情 + */ +export function draftInfoApi(id) { + return request({ + url: `/admin/pay/component/product/draft/get/${id}`, + method: 'get' + }) +} + +/** + * 视频号 草稿商品编辑 + */ +export function draftUpdateApi(data) { + return request({ + url: `/admin/pay/component/product/update`, + method: 'post', + data + }) +} diff --git a/admin/src/api/order.js b/admin/src/api/order.js index 2edb55ce..a6861642 100644 --- a/admin/src/api/order.js +++ b/admin/src/api/order.js @@ -2,7 +2,7 @@ import request from '@/utils/request' /** * 订单 列表 - * @param pram + * @param prams */ export function orderListApi(params) { return request({ @@ -12,10 +12,32 @@ export function orderListApi(params) { }) } +/** + * 订单 列表 获取各状态数量 + * @param params + */ +export function orderStatusNumApi(params) { + return request({ + url: '/admin/store/order/status/num', + method: 'get', + params + }) +} +/** + * 订单 列表 数据统计 + * @param params + */ +export function orderListDataApi(params) { + return request({ + url: '/admin/store/order/list/data', + method: 'get', + params + }) +} /** * 订单 删除 - * @param pram + * @param params */ export function orderDeleteApi(params) { return request({ @@ -27,7 +49,7 @@ export function orderDeleteApi(params) { /** * 订单 编辑 - * @param pram + * @param prams */ export function orderUpdateApi(data, params) { return request({ @@ -40,7 +62,7 @@ export function orderUpdateApi(data, params) { /** * 订单 记录 - * @param pram + * @param prams */ export function orderLogApi(params) { return request({ @@ -52,7 +74,7 @@ export function orderLogApi(params) { /** * 订单 详情 - * @param pram + * @param prams */ export function orderDetailApi(params) { return request({ @@ -64,7 +86,7 @@ export function orderDetailApi(params) { /** * 订单 备注 - * @param pram + * @param prams */ export function orderMarkApi(params) { return request({ @@ -76,7 +98,7 @@ export function orderMarkApi(params) { /** * 订单 发货 - * @param pram + * @param prams */ export function orderSendApi(data) { return request({ @@ -88,7 +110,7 @@ export function orderSendApi(data) { /** * 订单 拒绝退款 - * @param pram + * @param prams */ export function orderRefuseApi(params) { return request({ @@ -100,7 +122,7 @@ export function orderRefuseApi(params) { /** * 订单 立即退款 - * @param pram + * @param prams */ export function orderRefundApi(params) { return request({ @@ -112,7 +134,7 @@ export function orderRefundApi(params) { /** * 订单 核销订单 - * @param pram + * @param prams */ export function writeUpdateApi(vCode) { return request({ @@ -123,7 +145,7 @@ export function writeUpdateApi(vCode) { /** * 订单 核销码查询待核销订单 - * @param pram + * @param prams */ export function writeConfirmApi(vCode) { return request({ @@ -195,3 +217,24 @@ export function getLogisticsInfoApi(params) { params }) } + +/** + *视频号物流公司 + */ +export function companyGetListApi() { + return request({ + url: `/admin/pay/component/delivery/company/get/list`, + method: 'get' + }) +} + +/** + *视频号物流公司 + */ +export function videoSendApi(data) { + return request({ + url: `/admin/store/order/video/send`, + method: 'post', + data + }) +} diff --git a/admin/src/api/systemadmin.js b/admin/src/api/systemadmin.js index 37d21a7a..031c7df3 100644 --- a/admin/src/api/systemadmin.js +++ b/admin/src/api/systemadmin.js @@ -44,7 +44,8 @@ export function adminAdd(pram) { pwd: pram.pwd, realName: pram.realName, roles: pram.roles.join(','), - status: pram.status + status: pram.status, + phone: pram.phone } return request({ url: '/admin/system/admin/save', diff --git a/admin/src/api/user.js b/admin/src/api/user.js index 1b001943..517f34a8 100644 --- a/admin/src/api/user.js +++ b/admin/src/api/user.js @@ -357,3 +357,14 @@ export function updateSpreadApi(data) { data }) } + +/** + * @description 修改手机号 + */ +export function updatePhoneApi(params) { + return request({ + url: `/admin/user/update/phone`, + method: 'get', + params + }) +} diff --git a/admin/src/assets/imgs/pc1.jpg b/admin/src/assets/imgs/pc1.jpg index b5d77f25..e23fcd6a 100644 Binary files a/admin/src/assets/imgs/pc1.jpg and b/admin/src/assets/imgs/pc1.jpg differ diff --git a/admin/src/assets/js/canvas-nest.min.js b/admin/src/assets/js/canvas-nest.min.js new file mode 100644 index 00000000..2ed0be7b --- /dev/null +++ b/admin/src/assets/js/canvas-nest.min.js @@ -0,0 +1,85 @@ +// JavaScript Document +! function() { + function o(w, v, i) { + return w.getAttribute(v) || i + } + + function j(i) { + return document.getElementsByTagName(i) + } + + function l() { + var i = j("script"), + w = i.length, + v = i[w - 1]; + return { + l: w, + z: o(v, "zIndex", -2), + o: o(v, "opacity", 0.8), + c: o(v, "color", "255,255,255"), + n: o(v, "count", 240) + } + } + + function k() { + r = u.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, n = u.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight + } + + function b() { + delay = delay + 1; + if( delay < 5 ) { m(b) } else { delay = 0; + e.clearRect(0, 0, r, n); + var w = [f].concat(t); + var x, v, A, B, z, y; + t.forEach(function(i) { + i.x += i.xa, i.y += i.ya, i.xa *= i.x > r || i.x < 0 ? -1 : 1, i.ya *= i.y > n || i.y < 0 ? -1 : 1, e.fillRect(i.x - 0.5, i.y - 0.5, 2, 2);e.fillStyle="#FFFFFF"; + for (v = 0; v < w.length; v++) { + x = w[v]; + if (i !== x && null !== x.x && null !== x.y) { + B = i.x - x.x, z = i.y - x.y, y = B * B + z * z; + y < x.max && (x === f && y >= x.max / 2 && (i.x -= 0.03 * B, i.y -= 0.03 * z), A = (x.max - y) / x.max, e.beginPath(), e.lineWidth = A / 2, e.strokeStyle = "rgba(" + s.c + "," + (A + 0.2) + ")", e.moveTo(i.x, i.y), e.lineTo(x.x, x.y), e.stroke()) + } + } + w.splice(w.indexOf(i), 1) + }), m(b) } + } + var u = document.createElement("canvas"), + s = l(), + c = "c_n" + s.l, + e = u.getContext("2d"), + delay = 0, + r, n, m = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(i) { + window.setTimeout(i, 1000 / 45) + }, + a = Math.random, + f = { + x: null, + y: null, + max: 20000 + } + u.id = c; + u.style.cssText = "position:fixed;top:0;left:0;z-index:" + s.z + ";opacity:" + s.o; + j("body")[0].appendChild(u); + k(), window.onresize = k; + window.onmousemove = function(i) { + i = i || window.event, f.x = i.clientX, f.y = i.clientY + }, window.onmouseout = function() { + f.x = null, f.y = null + }; + for (var t = [], p = 0; s.n > p; p++) { + var h = a() * r, + g = a() * n, + q = 2 * a() - 1, + d = 2 * a() - 1; + t.push({ + x: h, + y: g, + xa: q, + ya: d, + max: 6000 + }) + } + setTimeout(function() { + b() + }, 100) +}(); \ No newline at end of file diff --git a/admin/src/components/Category/edit.vue b/admin/src/components/Category/edit.vue index c8e5a6d9..4f4c5807 100644 --- a/admin/src/components/Category/edit.vue +++ b/admin/src/components/Category/edit.vue @@ -8,7 +8,7 @@ > - + diff --git a/admin/src/components/couponList/couponFrom/index.js b/admin/src/components/couponList/couponFrom/index.js index 207d69c5..07d50a51 100644 --- a/admin/src/components/couponList/couponFrom/index.js +++ b/admin/src/components/couponList/couponFrom/index.js @@ -13,13 +13,14 @@ couponFrom.install = function(Vue, options) { const instance = new ToastConstructor() instance.$mount(document.createElement('div')) document.body.appendChild(instance.$el) - Vue.prototype.$modalCoupon = function(handle, keyNum, coupons=[], callback, userIds='') { + Vue.prototype.$modalCoupon = function(handle, keyNum, coupons=[], callback, userIds='', userType='') { instance.visible = true instance.handle = handle instance.keyNum = keyNum instance.coupons = coupons instance.userIds = userIds instance.callback = callback + instance.userType = userType } } export default couponFrom diff --git a/admin/src/components/couponList/couponFrom/index.vue b/admin/src/components/couponList/couponFrom/index.vue index b3447121..f7d74c4c 100644 --- a/admin/src/components/couponList/couponFrom/index.vue +++ b/admin/src/components/couponList/couponFrom/index.vue @@ -6,7 +6,7 @@ width="896px" :before-close="handleClose" > - + @@ -24,7 +24,8 @@ handle: '', keyNum: 0, coupons: [], - userIds: '' + userIds: '', + userType: '' } }, watch: { diff --git a/admin/src/components/couponList/index.vue b/admin/src/components/couponList/index.vue index 4fbb6650..1ef5bdea 100644 --- a/admin/src/components/couponList/index.vue +++ b/admin/src/components/couponList/index.vue @@ -3,8 +3,8 @@
- - + + @@ -91,7 +91,7 @@ + + diff --git a/admin/src/views/marketing/bargain/bargainGoods/creatBargain.vue b/admin/src/views/marketing/bargain/bargainGoods/creatBargain.vue index 267d285c..e7490832 100644 --- a/admin/src/views/marketing/bargain/bargainGoods/creatBargain.vue +++ b/admin/src/views/marketing/bargain/bargainGoods/creatBargain.vue @@ -218,9 +218,6 @@ - - -
{ @@ -614,8 +609,7 @@ status: res.status, num : res.num, bargainNum : res.bargainNum, - peopleNum : res.peopleNum, - rule : res.rule + peopleNum : res.peopleNum } if(res.specType){ this.ManyAttrValue = res.attrValues; diff --git a/admin/src/views/marketing/coupon/list/index.vue b/admin/src/views/marketing/coupon/list/index.vue index 61fcdf46..f367c986 100644 --- a/admin/src/views/marketing/coupon/list/index.vue +++ b/admin/src/views/marketing/coupon/list/index.vue @@ -108,12 +108,13 @@ /> - + @@ -179,7 +180,7 @@ diff --git a/admin/src/views/marketing/coupon/record/index.vue b/admin/src/views/marketing/coupon/record/index.vue index 3f1e6fff..0c93a30b 100644 --- a/admin/src/views/marketing/coupon/record/index.vue +++ b/admin/src/views/marketing/coupon/record/index.vue @@ -13,7 +13,7 @@ + :remote-method="remoteMethod" :loading="loading" placeholder="请输入领取人" clearable @change="seachList"> - - - - + + +
@@ -58,8 +52,8 @@ sortable label="明细数字" min-width="120" - prop="number" - :sort-method="(a,b)=>{return a.number - b.number}" + prop="integral" + :sort-method="(a,b)=>{return a.integral - b.integral}" /> @@ -94,7 +88,6 @@ + + diff --git a/admin/src/views/sms/smsConfig/components/loginFrom.vue b/admin/src/views/sms/smsConfig/components/loginFrom.vue index 85802c67..9af75734 100644 --- a/admin/src/views/sms/smsConfig/components/loginFrom.vue +++ b/admin/src/views/sms/smsConfig/components/loginFrom.vue @@ -38,11 +38,19 @@ 登录 -
+
忘记密码 注册账户
+ + 平台说明 + diff --git a/admin/src/views/sms/smsConfig/index.vue b/admin/src/views/sms/smsConfig/index.vue index 531e113c..cdb8c330 100644 --- a/admin/src/views/sms/smsConfig/index.vue +++ b/admin/src/views/sms/smsConfig/index.vue @@ -11,6 +11,15 @@ 修改密码 修改手机号 退出登录 + + 平台说明 + +
diff --git a/admin/src/views/sms/smsPay/index.vue b/admin/src/views/sms/smsPay/index.vue index 438ee5e2..8dc18b98 100644 --- a/admin/src/views/sms/smsPay/index.vue +++ b/admin/src/views/sms/smsPay/index.vue @@ -51,7 +51,7 @@ >
¥ {{ item.price }}
- 短信条数: {{ item.num }} + {{tableFrom.type | onePassTypeFilter}}条数: {{ item.num }}
diff --git a/admin/src/views/store/creatStore/index.vue b/admin/src/views/store/creatStore/index.vue index 5cfebf1d..63701c9f 100644 --- a/admin/src/views/store/creatStore/index.vue +++ b/admin/src/views/store/creatStore/index.vue @@ -6,7 +6,7 @@ - + @@ -14,32 +14,32 @@ - + - + - + - + - + -
+
@@ -61,9 +61,9 @@ @dragend="handleDragEnd($event, item)" > - +
-
+
@@ -74,7 +74,7 @@
- + - 添加运费模板 + 添加运费模板
- - -
- - {{ tag.name }} - - 选择优惠券 -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - -
-
{{item}}
-
可拖动按钮调整活动的优先展示顺序
-
-
-
-
- - + 单规格 多规格 - + 单独设置 默认设置 - +
@@ -233,7 +162,7 @@ - + @@ -287,30 +216,30 @@ - + @@ -326,20 +255,20 @@ - + @@ -348,10 +277,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + +
+
{{item}}
+
可拖动按钮调整活动的优先展示顺序
+
+
+
+ + +
+ + {{ tag.name }} + + + 选择优惠券 +
+
+
+
上一步 - 下一步 - 提交 + 下一步 + 提交 @@ -434,6 +442,7 @@ components: {Templates, CreatTemplates }, data() { return { + isDisabled: this.$route.params.isDisabled==='1'?true:false, activity: { '默认': 'red', '秒杀': 'blue', '砍价': 'green', '拼团': 'yellow' }, props2: { children: 'child', @@ -581,7 +590,7 @@ }, '') }, setTagsViewTitle() { - const title = '编辑商品' + const title = this.isDisabled?'商品详情':'编辑商品' const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.id}` }) this.$store.dispatch('tagsView/updateVisitedView', route) }, @@ -804,6 +813,7 @@ this.isBtn = false }, clearAttr() { + this.isAttr = true this.formDynamic.attrsName = '' this.formDynamic.attrsVal = '' }, @@ -860,7 +870,7 @@ getInfo () { this.fullscreenLoading = true productDetailApi(this.$route.params.id).then(async res => { - this.isAttr = false; + this.isAttr = true; let info = res this.formValidate = { image: this.$selfUtil.setDomain(info.image), @@ -896,7 +906,7 @@ let imgss = [] Object.keys(imgs).map(i => { imgss.push(this.$selfUtil.setDomain(imgs[i])) - }) + }) this.formValidate.sliderImages = [ ...imgss ] if(info.isHot) this.checkboxGroup.push('isHot') if(info.isGood) this.checkboxGroup.push('isGood') @@ -940,7 +950,8 @@ }, // 点击商品图 modalPicTap (tit, num, i) { - const _this = this + const _this = this; + if(_this.isDisabled) return; this.$modalUpload(function(img) { if(tit==='1'&& !num){ _this.formValidate.image = img[0].sattDir @@ -1032,40 +1043,55 @@ }, // 移动 handleDragStart (e, item) { - this.dragging = item; + if(!this.isDisabled) this.dragging = item; }, handleDragEnd (e, item) { - this.dragging = null + if(!this.isDisabled) this.dragging = null }, handleDragOver (e) { - e.dataTransfer.dropEffect = 'move' + if(!this.isDisabled) e.dataTransfer.dropEffect = 'move' }, handleDragEnter (e, item) { - e.dataTransfer.effectAllowed = 'move' - if (item === this.dragging) { - return + if(!this.isDisabled){ + e.dataTransfer.effectAllowed = 'move' + if (item === this.dragging) { + return + } + const newItems = [...this.formValidate.sliderImages] + const src = newItems.indexOf(this.dragging) + const dst = newItems.indexOf(item) + newItems.splice(dst, 0, ...newItems.splice(src, 1)) + this.formValidate.sliderImages = newItems; } - const newItems = [...this.formValidate.sliderImages] - const src = newItems.indexOf(this.dragging) - const dst = newItems.indexOf(item) - newItems.splice(dst, 0, ...newItems.splice(src, 1)) - this.formValidate.sliderImages = newItems; }, handleDragEnterFont(e, item) { - e.dataTransfer.effectAllowed = 'move' - if (item === this.dragging) { - return + if(!this.isDisabled){ + e.dataTransfer.effectAllowed = 'move' + if (item === this.dragging) { + return + } + const newItems = [...this.formValidate.activity] + const src = newItems.indexOf(this.dragging) + const dst = newItems.indexOf(item) + newItems.splice(dst, 0, ...newItems.splice(src, 1)) + this.formValidate.activity = newItems; } - const newItems = [...this.formValidate.activity] - const src = newItems.indexOf(this.dragging) - const dst = newItems.indexOf(item) - newItems.splice(dst, 0, ...newItems.splice(src, 1)) - this.formValidate.activity = newItems; } } } \ No newline at end of file + diff --git a/app/api/activity.js b/app/api/activity.js index 935f03ee..fe62b3d0 100644 --- a/app/api/activity.js +++ b/app/api/activity.js @@ -55,7 +55,7 @@ export function getBargainList(data) { * @param object data */ export function getBargainUserList(data){ - return request.get('bargain/user/list',data); + return request.get('bargain/record',data); } @@ -76,12 +76,13 @@ export function getBargainDetail(id) { } /** - * 砍价 开启砍价用户信息 + * 用户砍价信息,注意自己的活动和别人的活动的区别 */ -export function postBargainStartUser(data) { - return request.get("bargain/start/user", data); +export function getBargainUser(data) { + return request.get("bargain/user", data); } + /** * 砍价开启 */ @@ -110,20 +111,6 @@ export function postBargainHelpList(params,data) { return request.get("bargain/help/list?limit="+params.limit+"&page="+params.page, data,{}); } -/** - * 砍价 砍价帮总人数、剩余金额、进度条、已经砍掉的价格 - */ -export function postBargainHelpCount(data) { - return request.get("bargain/help/count", data,1); -} - -/** - * 砍价 观看/分享/参与次数 - */ -export function postBargainShare(bargainId) { - return request.get("bargain/share/" + bargainId); -} - /** * 秒杀产品时间区间 * @@ -193,5 +180,41 @@ export function scombinationCode(id) { * @param int id */ export function getSeckillHeaderApi(){ + return request.get('seckill/header',{},{noAuth:true}); +} + +/** + * 首页秒杀产品列表 +*/ +export function getSeckillIndexApi(){ return request.get('seckill/index',{},{noAuth:true}); +} + + +/** + * 首页拼团产品列表 +*/ +export function getCombinationIndexApi(){ + return request.get('combination/index',{},{noAuth:true}); +} + +/** + * 首页砍价产品列表 +*/ +export function getBargainIndexApi(){ + return request.get('bargain/index',{},{noAuth:true}); +} + +/** + * 首页砍价产品列表 +*/ +export function bargainHeaderApi(){ + return request.get('bargain/header'); +} + +/** + * 拼图列表头部 +*/ +export function combinationHeaderApi(){ + return request.get('combination/header'); } \ No newline at end of file diff --git a/app/api/api.js b/app/api/api.js index 7f9e3d42..8d1845b9 100644 --- a/app/api/api.js +++ b/app/api/api.js @@ -120,9 +120,6 @@ export function verifyCode(){ export function registerVerify(phone){ return request.post('sendCode', { phone: phone },{noAuth:true},1) } -// export function registerVerify(phone, reset, key, code){ -// return request.post('register/verify', { phone: phone, type: reset === undefined ? 'reset' : reset, key: key, code: code },{noAuth:true}) -// } /** * 手机号注册 diff --git a/app/api/order.js b/app/api/order.js index b85ca090..4efb6c71 100644 --- a/app/api/order.js +++ b/app/api/order.js @@ -4,10 +4,8 @@ import request from "@/utils/request.js"; * 获取购物车列表 * @param numType boolean true 购物车数量,false=购物车产品数量 */ -export function getCartCounts(numType) { - return request.get("cart/count", { - numType: numType === undefined ? true : numType - }); +export function getCartCounts(numType,type) { + return request.get("cart/count?numType=" + numType + "&type=" + type); } /** * 获取购物车列表 @@ -184,8 +182,8 @@ export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain * @param string price * */ -export function getCouponsOrderPrice(data) { - return request.get('coupons/order', data) +export function getCouponsOrderPrice(preOrderNo) { + return request.get(`coupons/order/${preOrderNo}`) } /** @@ -194,8 +192,8 @@ export function getCouponsOrderPrice(data) { * @param object data * */ -export function orderCreate(key, data) { - return request.post('order/create/' + key, data); +export function orderCreate(data) { + return request.post('order/create', data); } /** @@ -204,8 +202,8 @@ export function orderCreate(key, data) { * @param data * @returns {*} */ -export function postOrderComputed(key, data) { - return request.post("order/computed/" + key, data); +export function postOrderComputed(data) { + return request.post("order/computed/price", data); } /** @@ -229,5 +227,29 @@ export function wechatOrderPay(data) { * @param object data */ export function wechatQueryPayResult(data) { - return request.get('pay/queryPayResult', data); + return request.get('pay/queryPayResult?orderNo=' + data); +} + +/** + * 申请退款商品详情 + * @param object data + */ +export function applyRefund(orderId) { + return request.get(`order/apply/refund/${orderId}`); +} + +/** + * 预下单 + * @param object data + */ +export function preOrderApi(data) { + return request.post(`order/pre/order`, data); +} + +/** + * 加载预下单 + * @param object preOrderNo + */ +export function loadPreOrderApi(preOrderNo) { + return request.get(`order/load/pre/${preOrderNo}`); } \ No newline at end of file diff --git a/app/api/public.js b/app/api/public.js index 8cafef0b..91144d0e 100644 --- a/app/api/public.js +++ b/app/api/public.js @@ -12,22 +12,15 @@ export function getWechatConfig() { return request.get("wechat/config",{ url: encodeURIComponent(wechat.signLink()) },{ noAuth: true }); } -// export function getWechatConfig() { -// return request.get( -// "wechat/config", -// { url: encodeURIComponent(location.href.split('#')[0]) }, -// { noAuth: true } -// ); -// } - /** * 获取微信sdk配置 * @returns {*} */ -export function wechatAuth(code, spread, login_type) { +export function wechatAuth(code, spread) { + var reg=/^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 ,判断正整数用/^[1-9]+[0-9]*]*$/ + spread = reg.test(spread) ? spread : 0; return request.get( - "wechat/authorize/login", - { code, spread_spid:spread, login_type }, + "wechat/authorize/login?code=" + code + "&spread_spid=" + spread, {}, { noAuth: true } ); } @@ -98,14 +91,26 @@ export function getUserPhone(data){ } /** - * 静默授权 + * APP微信登录 * @param {Object} data */ -export function silenceAuth(data) { - //#ifdef MP - return request.get("wechat/authorize/program/login", data, { noAuth : true }); - //#endif - //#ifdef H5 - return request.get("wechat/authorize/login", data, { noAuth : true }); - //#endif +export function appAuth(data) { + return request.post("wechat/authorize/app/login", data, { noAuth : true }); +} + +/** + * 苹果登录 + * @param {Object} data + */ +export function appleLogin(data) { + return request.post("ios/login", data, { noAuth : true }); +} + + +/** + * 苹果绑定手机号 + * @param {Object} data + */ +export function iosBinding(data) { + return request.post("ios/binding/phone", data, { noAuth : true }); } \ No newline at end of file diff --git a/app/api/store.js b/app/api/store.js index c2622e25..0be14a76 100644 --- a/app/api/store.js +++ b/app/api/store.js @@ -5,8 +5,8 @@ import request from "@/utils/request.js"; * @param int id * */ -export function getProductDetail(id) { - return request.get('product/detail/' + id, {}, { +export function getProductDetail(id, type) { + return request.get('product/detail/' + id + '?type=' + type, {}, { noAuth: true }); } @@ -41,15 +41,20 @@ export function collectAdd(id, category) { } /** - * 删除收藏产品 + * 取消收藏产品 * @param int id - * @param string category product=普通产品,product_seckill=秒杀产品 */ -export function collectDel(id, category) { - return request.post('collect/del', { - id: id, - 'category': category === undefined ? 'product' : category - }); +export function collectDel(proId) { + return request.post(`collect/cancel/${proId}`); +} + + +/** + * 删除收藏产品 + * @param string id + */ +export function collectDelete(ids) { + return request.post(`collect/delete`,ids); } /** @@ -111,7 +116,7 @@ export function collectAll(id, category) { * */ export function getGroomList(type, data) { - return request.get('groom/list/' + type, data, { + return request.get('index/product/' + type, data, { noAuth: true }); } @@ -163,3 +168,24 @@ export function getSearchKeyword() { export function storeListApi(data) { return request.post("store/list", data, {}, 1); } + + +/** + * 优品推荐 + * @param object data + */ +export function getProductGood() { + return request.get('product/good'); +} + +/** + * 详情页产品评论 + * @param int id + * @param object data + * + */ +export function getReplyProduct(id) { + return request.get('reply/product/' + id, { + noAuth: true + }) +} \ No newline at end of file diff --git a/app/api/user.js b/app/api/user.js index 6e42b90a..f929d166 100644 --- a/app/api/user.js +++ b/app/api/user.js @@ -46,9 +46,6 @@ export function getCodeApi() { export function registerVerify(phone){ return request.post('sendCode', { phone: phone },{noAuth:true},1) } -// export function registerVerify(data) { -// return request.post("register/verify", data, { noAuth : true }); -// } /** * h5用户手机号注册 @@ -176,7 +173,7 @@ export function spreadCount(type){ } /* - * 推广数据 + * 推广数据 当前佣金 提现总金额 * */ export function getSpreadInfo() { return request.get("commission"); @@ -316,6 +313,13 @@ export function rechargeWechat(data) { return request.post("recharge/wechat", data); } +/* + * app微信充值 + * */ +export function appWechat(data) { + return request.post("recharge/wechat/app", data); +} + /* * 余额充值 * */ @@ -365,7 +369,7 @@ export function getChatRecord(to_uid, data) { */ export function spread(puid) { - return request.get("user/bindSpread?spreadPid=" + puid); + return request.get("user/bindSpread?spreadPid="+ puid); } /** @@ -414,5 +418,23 @@ export function getBillList(data) return request.get("recharge/bill/record",data); } +/* + * 积分中心详情 + * */ +export function postIntegralUser() { + return request.get("integral/user"); +} +/* + * 立即提现 冻结期、冻结佣金、可提现佣金、最低可提现金额 + * */ +export function extractUser() { + return request.get("extract/user"); +} +/* + * 推广人统计页 推广人数(一级+二级)、一级人数、二级人数 + * */ +export function spreadPeoCount() { + return request.get("spread/people/count"); +} \ No newline at end of file diff --git a/app/components/Authorize.vue b/app/components/Authorize.vue index cb7dd06c..8ddc8cbe 100644 --- a/app/components/Authorize.vue +++ b/app/components/Authorize.vue @@ -10,8 +10,7 @@ - - + @@ -59,52 +58,6 @@ this.setAuthStatus(); }, methods:{ - getUserProfile() { - let self = this; - uni.showLoading({ - title: '正在登录中' - }); - Routine.getUserProfile() - .then(res => { - Routine.getCode() - .then(code => { - self.getWxUser(code, res); - }) - .catch(res => { - uni.hideLoading(); - }); - }) - .catch(res => { - uni.hideLoading(); - }); - }, - - getWxUser(code, res) { - let self = this - let userInfo = res.userInfo; - userInfo.code = code; - userInfo.spread_spid = app.globalData.spid; //获取推广人ID - userInfo.spread_code = app.globalData.code; //获取推广人分享二维码ID - userInfo.avatar = userInfo.userInfo.avatarUrl; - userInfo.city = userInfo.userInfo.city; - userInfo.country = userInfo.userInfo.country; - userInfo.nickName = userInfo.userInfo.nickName; - userInfo.province = userInfo.userInfo.province; - userInfo.sex = userInfo.userInfo.gender; - userInfo.type = 'routine' - Routine.authUserInfo(code,userInfo).then(res=>{ - uni.hideLoading(); - this.$emit('authColse',false); - this.$emit('onLoadFun',this.userInfo); - }).catch(res=>{ - uni.hideLoading(); - uni.showToast({ - title:res.message, - icon:'none', - duration:2000 - }); - }); - }, setAuthStatus(){ Routine.authorize().then(res=>{ if(res.islogin === false) @@ -118,7 +71,6 @@ }, getUserInfo(code){ Routine.getUserInfo().then(res=>{ - console.log('res',res); let userInfo = res.userInfo userInfo.code = code; userInfo.spread_spid = app.globalData.spid;//获取推广人ID @@ -187,7 +139,7 @@ .Popup .bottom .item{width:50%;height:80rpx;background-color:#eeeeee;text-align:center;line-height:80rpx;font-size:24rpx;color:#666;margin-top:54rpx;} .Popup .bottom .item.on{width: 100%} .flex{display:flex;} - .Popup .bottom .item.grant{font-size:28rpx;color:#fff;font-weight:bold;background-color:#e93323;border-radius:0;padding:0;} + .Popup .bottom .item.grant{font-size:28rpx;color:#fff;font-weight:bold;background-color:$theme-color;border-radius:0;padding:0;} .mask{position:fixed;top:0;right:0;left:0;bottom:0;background-color:rgba(0,0,0,0.65);z-index:310;} diff --git a/app/components/addressWindow/index.vue b/app/components/addressWindow/index.vue index 49aa0fd1..7f681950 100644 --- a/app/components/addressWindow/index.vue +++ b/app/components/addressWindow/index.vue @@ -45,21 +45,26 @@ isLog: { type: Boolean, default: false, - }, + } }, data() { return { active: 0, - //地址列表 - addressList: [], - is_loading: true + is_loading: true, + addressList: [] }; }, methods: { tapAddress: function(e, addressid) { this.active = e; - this.$emit('OnChangeAddress', addressid); + let a = {}; + for (let i = 0, leng = this.addressList.length; i < leng; i++) { + if (this.addressList[i].id == addressid) { + a = this.addressList[i]; + } + } + this.$emit('OnChangeAddress', a); }, close: function() { this.$emit('changeClose'); @@ -79,14 +84,18 @@ limit: 5 }).then(res => { let addressList = res.data.list; + that.$set(that, 'addressList', addressList); + that.is_loading = false; + let defaultAddress = {}; //处理默认选中项 + if(!that.address.addressId) return; for (let i = 0, leng = addressList.length; i < leng; i++) { if (addressList[i].id == that.address.addressId) { that.active = i; + defaultAddress = this.addressList[i]; } } - that.$set(that, 'addressList', addressList); - that.is_loading = false; + this.$emit('OnDefaultAddress', defaultAddress); }) } } diff --git a/app/components/countDown/index.vue b/app/components/countDown/index.vue index 5636aa04..291c6e6e 100644 --- a/app/components/countDown/index.vue +++ b/app/components/countDown/index.vue @@ -1,14 +1,14 @@ @@ -52,6 +52,10 @@ isCol: { type: Boolean, default: false + }, + bgColor: { + type: Object, + default: null } }, data: function() { @@ -112,7 +116,29 @@ }; - diff --git a/app/components/couponListWindow/index.vue b/app/components/couponListWindow/index.vue index a7fa2cf7..9df55d8f 100644 --- a/app/components/couponListWindow/index.vue +++ b/app/components/couponListWindow/index.vue @@ -1,110 +1,235 @@ diff --git a/app/components/emptyPage.vue b/app/components/emptyPage.vue index 17814c3e..0d737d77 100644 --- a/app/components/emptyPage.vue +++ b/app/components/emptyPage.vue @@ -24,6 +24,7 @@ justify-content: center; align-items: center; margin-top: 200rpx; + padding-bottom: 60rpx; image{ width: 414rpx; height: 240rpx; diff --git a/app/components/home/index.vue b/app/components/home/index.vue index 665f452b..f1b92622 100644 --- a/app/components/home/index.vue +++ b/app/components/home/index.vue @@ -73,7 +73,7 @@ border-radius: 50rpx; opacity: 0; height: 0; - color: #e93323; + color: $theme-color; width: 0; } diff --git a/app/components/login_mobile/index.vue b/app/components/login_mobile/index.vue index b78d26a6..33a9c4f0 100644 --- a/app/components/login_mobile/index.vue +++ b/app/components/login_mobile/index.vue @@ -1,7 +1,7 @@ @@ -18,6 +18,7 @@ const app = getApp(); import sendVerifyCode from "@/mixins/SendVerifyCode"; import Routine from '@/libs/routine'; + import {mapGetters} from "vuex"; import { loginMobile, registerVerify, @@ -26,32 +27,59 @@ phoneSilenceAuth, phoneWxSilenceAuth } from "@/api/user"; - import { bindingPhone } from '@/api/api.js' - import { getUserPhone } from '@/api/public'; - export default{ - name:'login_mobile', - props:{ - isUp:{ - type:Boolean, - default:false, + import { + bindingPhone + } from '@/api/api.js' + import { + getUserPhone, + iosBinding + } from '@/api/public'; + const BACK_URL = "login_back_url"; + export default { + name: 'login_mobile', + computed: mapGetters(['userInfo','isLogin']), + props: { + isUp: { + type: Boolean, + default: false, }, - authKey:{ - type:String, - default:'', + authKey: { + type: String, + default: '', + }, + isShow: { + type: Boolean, + default: true + }, + isPos: { + type: Boolean, + default: true + }, + appleShow: { + type: String, + default: '' + }, + platform: { + type: String, + default: '', } }, - data(){ + data() { return { - keyCode:'', - account:'', - codeNum:'' + keyCode: '', + account: '', + codeNum: '', + isApp: 0 } }, mixins: [sendVerifyCode], mounted() { //this.getCode(); }, - methods:{ + onLoad() { + + }, + methods: { // 获取验证码 async code() { let that = this; @@ -61,12 +89,14 @@ if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({ title: '请输入正确的手机号码' }); - await registerVerify(that.account).then(res=>{ - that.$util.Tips({title:res.msg}); + await registerVerify(that.account).then(res => { + that.$util.Tips({ + title: res.msg + }); that.sendCode(); - }).catch(err=>{ + }).catch(err => { return that.$util.Tips({ - title:err + title: err }) }) }, @@ -81,11 +111,11 @@ }); }); }, - close(){ - this.$emit('close',false) + close() { + this.$emit('close', false) }, // 登录 - loginBtn(){ + loginBtn() { let that = this if (!that.account) return that.$util.Tips({ title: '请填写手机号码' @@ -99,47 +129,66 @@ if (!/^[\w\d]+$/i.test(that.codeNum)) return that.$util.Tips({ title: '请输入正确的验证码' }); - uni.showLoading({ title: '正在登录中' }); - getUserPhone({ - captcha: that.codeNum, - phone: that.account, - spid: app.globalData.spid, - spread: app.globalData.code, - type: 'public', - key: this.authKey - }).then(res=>{ - let time = res.data.expires_time - this.$Cache.time(); - this.$store.commit('LOGIN', { - token: res.data.token, - time: time - }); - this.getUserInfo(); - }).catch(error=>{ - uni.hideLoading() - this.$util.Tips({ - title:error + uni.showLoading({ + title: !this.userInfo.phone && this.isLogin?'正在绑定中':'正在登录中' + }); + if (!this.userInfo.phone && this.isLogin) { + iosBinding({ + captcha: that.codeNum, + phone: that.account + }).then(res => { + that.$util.Tips({ + title: '绑定手机号成功', + icon: 'success' + }, { + tab: 3 + }) + that.isApp = 1; + that.getUserInfo(); + }).catch(error => { + uni.hideLoading() + that.$util.Tips({ + title: error + }) }) - }) + } else { + getUserPhone({ + captcha: that.codeNum, + phone: that.account, + // #ifdef H5 + type: 'public', + // #endif + key: that.authKey + }).then(res => { + that.$store.commit('LOGIN', { + token: res.data.token + }); + that.$store.commit("SETUID", res.data.uid); + that.getUserInfo(); + }).catch(error => { + uni.hideLoading() + that.$util.Tips({ + title: error + }) + }) + } }, // #ifdef MP - phoneSilenceAuth(code){ + phoneSilenceAuth(code) { let self = this phoneSilenceAuth({ - code:code, + code: code, spid: app.globalData.spid, spread: app.globalData.code, - phone:this.account, - captcha:this.codeNum - }).then(res=>{ - let time = res.data.expires_time - this.$Cache.time(); - this.$store.commit('LOGIN', { - token: res.data.token, - time: time - }); + phone: this.account, + captcha: this.codeNum + }).then(res => { + this.$store.commit('LOGIN', res.data.token); + this.$store.commit("SETUID", res.data.uid); this.getUserInfo(); - }).catch(error=>{ + }).catch(error => { self.$util.Tips({ - title:error + title: error }) }) }, @@ -151,52 +200,56 @@ let that = this; getUserInfo().then(res => { uni.hideLoading(); - that.userInfo = res.data - that.$store.commit("SETUID", res.data.uid); that.$store.commit("UPDATE_USERINFO", res.data); - // #ifdef MP + // #ifdef MP that.$util.Tips({ - title:'登录成功', - icon:'success' - },{ - tab:3 + title: '登录成功', + icon: 'success' + }, { + tab: 3 }) that.close() // #endif // #ifdef H5 - that.$emit('wechatPhone',true) + that.$emit('wechatPhone', true) // #endif }); }, } } - - diff --git a/app/components/login_mobile/routine_phone.vue b/app/components/login_mobile/routine_phone.vue index 4d5b8800..f4082628 100644 --- a/app/components/login_mobile/routine_phone.vue +++ b/app/components/login_mobile/routine_phone.vue @@ -20,7 +20,7 @@ getCodeApi, getUserInfo } from "@/api/user"; - import { getLogo, silenceAuth, getUserPhone } from '@/api/public'; + import { getLogo, getUserPhone } from '@/api/public'; export default{ name:'routine_phone', props:{ @@ -51,7 +51,6 @@ // #ifdef MP // 小程序获取手机号码 getphonenumber(e){ - console.log(e) uni.showLoading({ title: '加载中' }); Routine.getCode() .then(code => { @@ -67,22 +66,21 @@ encryptedData: encryptedData, iv: iv, code: code, - spid: app.globalData.spid, - spread: app.globalData.code, key:this.authKey, type: 'routine' }) .then(res => { - let time = res.data.expires_time - this.$Cache.time(); this.$store.commit('LOGIN', { - token: res.data.token, - time: time + token: res.data.token }); + this.$store.commit("SETUID", res.data.uid); this.getUserInfo(); }) .catch(res => { - console.log(res); uni.hideLoading(); + this.$util.Tips({ + title: res + }); }); }, /** @@ -93,7 +91,6 @@ getUserInfo().then(res => { uni.hideLoading(); that.userInfo = res.data - that.$store.commit("SETUID", res.data.uid); that.$store.commit("UPDATE_USERINFO", res.data); that.isStatus = true this.close() @@ -150,7 +147,7 @@ height: 86rpx; line-height: 86rpx; margin-top: 60rpx; - background: #E93323; + background: $theme-color; border-radius: 43rpx; color: #fff; font-size: 28rpx; diff --git a/app/components/orderGoods/index.vue b/app/components/orderGoods/index.vue index ad5fb318..db27710b 100644 --- a/app/components/orderGoods/index.vue +++ b/app/components/orderGoods/index.vue @@ -1,26 +1,27 @@ diff --git a/app/components/productWindow/index.vue b/app/components/productWindow/index.vue index 1aaa9367..2beaa8d5 100644 --- a/app/components/productWindow/index.vue +++ b/app/components/productWindow/index.vue @@ -1,6 +1,7 @@ @@ -111,29 +115,60 @@ }, selfLocation() { let self = this - uni.getLocation({ - type: 'wgs84', - success: function(res) { - try { - uni.setStorageSync('user_latitude', res.latitude); - uni.setStorageSync('user_longitude', res.longitude); - } catch {} + // #ifdef H5 + if (self.$wechat.isWeixin()) { + self.$wechat.location().then(res => { + this.user_latitude = res.latitude; + this.user_longitude = res.longitude; + uni.setStorageSync('user_latitude', res.latitude); + uni.setStorageSync('user_longitude', res.longitude); self.getList(); - }, - complete:function() { - self.getList(); - } - }); + }) + } else { + // #endif + uni.getLocation({ + type: 'wgs84', + success: (res) => { + try { + this.user_latitude = res.latitude; + this.user_longitude = res.longitude; + uni.setStorageSync('user_latitude', res.latitude); + uni.setStorageSync('user_longitude', res.longitude); + } catch {} + self.getList(); + }, + complete: function() { + self.getList(); + } + }); + // #ifdef H5 + } + // #endif }, showMaoLocation(e) { - uni.openLocation({ - latitude: Number(e.latitude), - longitude: Number(e.longitude), - success: function() { + let self = this; + // #ifdef H5 + if (self.$wechat.isWeixin()) { + self.$wechat.seeLocation({ + latitude: Number(e.latitude), + longitude: Number(e.longitude) + }).then(res => { console.log('success'); - Number - } - }); + }) + } else { + // #endif + uni.openLocation({ + latitude: Number(e.latitude), + longitude: Number(e.longitude), + name: e.name, + address: `${e.address}-${e.detailedAddress}`, + success: function() { + console.log('success'); + } + }); + // #ifdef H5 + } + // #endif }, // 选中门店 checked(e) { @@ -241,9 +276,10 @@ border-radius: 50%; display: block; text-align: center; - line-height: 50rpx; + line-height: 48rpx; background-color: #e83323; margin-bottom: 22rpx; + text-decoration: none; } .store-distance { diff --git a/app/pages/users/goods_logistics/index.vue b/app/pages/users/goods_logistics/index.vue index 957f8328..7155ddd1 100644 --- a/app/pages/users/goods_logistics/index.vue +++ b/app/pages/users/goods_logistics/index.vue @@ -3,13 +3,13 @@ - + - {{product.productInfo.storeName}} + {{product.productName}} - ¥{{product.truePrice}} - x{{product.cartNum}} + ¥{{product.price}} + x{{product.payNum}} @@ -40,7 +40,7 @@ - + @@ -106,13 +106,7 @@ this.getExpress(); this.get_host_product(); } else { - // #ifdef H5 || APP-PLUS toLogin(); - // #endif - // #ifdef MP - this.isAuto = true; - this.$set(this, 'isShowAuth', true); - // #endif } }, onReady: function() { @@ -142,30 +136,11 @@ let that=this; express(that.orderId).then(function(res){ let result = res.data.express|| {}; - that.$set(that,'product',res.data.order.cartInfo[0] || {}); + that.$set(that,'product',res.data.order.info[0] || {}); that.$set(that,'orderInfo',res.data.order); that.$set(that,'expressList',result.list || []); }); }, - /** - * 获取我的推荐 - */ - // getGroomList(onloadH) { - // this.loading = true - // if (!this.goodScroll) return - // if (onloadH) { - // this.iSshowH = true - // } - // getGroomList(type, this.params).then(({ - // data - // }) => { - // this.iSshowH = false - // this.loading = false - // this.goodScroll = data.list.length >= this.params.limit - // this.params.page++ - // this.tempArr = this.tempArr.concat(data.list) - // }) - // } get_host_product: function () { this.loading = true if (!this.goodScroll) return @@ -176,7 +151,6 @@ that.goodScroll = res.data.list.length >= that.params.limit that.params.page++ that.hostProduct = that.hostProduct.concat(res.data.list) - // that.$set(that,'hostProduct',res.data.list); }); }, }, @@ -271,7 +245,7 @@ height: 40rpx; text-align: center; line-height: 40rpx; - border-radius: 3rpx; + border-radius: 20rpx; border: 1rpx solid #999; } @@ -291,15 +265,15 @@ } .logistics .logisticsCon .item .circular.on { - background-color: #e93323; + background-color: $theme-color; } .logistics .logisticsCon .item .text.on-font { - color: #e93323; + color: $theme-color; } .logistics .logisticsCon .item .text .data.on-font { - color: #e93323; + color: $theme-color; } .logistics .logisticsCon .item .text { diff --git a/app/pages/users/goods_return/index.vue b/app/pages/users/goods_return/index.vue index 1f9c6579..a09e1ee2 100644 --- a/app/pages/users/goods_return/index.vue +++ b/app/pages/users/goods_return/index.vue @@ -2,21 +2,17 @@
- - + + - {{item.info.productInfo.storeName}} - - ¥{{item.info.productInfo.attrInfo.price}} - x{{item.info.cartNum}} - - - ¥{{item.info.productInfo.price}} - x{{item.info.cartNum}} + {{item.storeName}} + + ¥{{item.price}} + x{{item.cartNum}} - + 退货件数 {{orderInfo.totalNum}} @@ -38,7 +34,7 @@ 备注说明 - + 上传凭证 ( 最多可上传3张 ) @@ -54,17 +50,17 @@ + - - + diff --git a/app/pages/users/kefu/index.vue b/app/pages/users/kefu/index.vue new file mode 100644 index 00000000..1c539f96 --- /dev/null +++ b/app/pages/users/kefu/index.vue @@ -0,0 +1,34 @@ + + + diff --git a/app/pages/users/login/index.vue b/app/pages/users/login/index.vue index ecd413ad..7b2753eb 100644 --- a/app/pages/users/login/index.vue +++ b/app/pages/users/login/index.vue @@ -1,47 +1,37 @@ @@ -126,7 +76,7 @@ validatorDefaultCatch } from "@/utils/dialog"; import { - getLogo + getLogo, appAuth, appleLogin } from "@/api/public"; import { VUE_APP_API_URL @@ -140,7 +90,7 @@ data: function() { return { navList: ["快速登录", "账号登录"], - current: 0, + current: 1, account: "", password: "", captcha: "", @@ -150,7 +100,13 @@ keyCode: "", codeUrl: "", codeVal: "", - isShowCode: false + isShowCode: false, + platform: '', + appLoginStatus: false, // 微信登录强制绑定手机号码状态 + appUserInfo: null, // 微信登录保存的用户信息 + appleLoginStatus: false, // 苹果登录强制绑定手机号码状态 + appleUserInfo: null, + appleShow: false // 苹果登录版本必须要求ios13以上的 }; }, watch:{ @@ -166,7 +122,143 @@ this.getCode(); this.getLogoImage(); }, + onLoad() { + let self = this + uni.getSystemInfo({ + success: function(res) { + if (res.platform.toLowerCase() == 'ios' && res.system.split(' ')[1] >= 13) { + self.appleShow = true + } + } + }); + }, methods: { + // 苹果登录 + appleLogin() { + let self = this + this.account = '' + this.captcha = '' + uni.showLoading({ + title: '登录中' + }) + uni.login({ + provider: 'apple', + timeout: 10000, + success(loginRes) { + uni.getUserInfo({ + provider: 'apple', + success: function(infoRes) { + self.appleUserInfo = infoRes.userInfo + self.appleLoginApi() + }, + fail() { + uni.hideLoading() + uni.showToast({ + title: '获取用户信息失败', + icon: 'none', + duration: 2000 + }) + }, + complete() { + uni.hideLoading() + } + }); + }, + fail(error) { + uni.hideLoading() + console.log(error) + } + }) + }, + // 苹果登录Api + appleLoginApi() { + let self = this + appleLogin({ + openId: self.appleUserInfo.openId, + email: self.appleUserInfo.email == undefined ? '' :self.appleUserInfo.email, + identityToken: self.appleUserInfo.identityToken || '' + }).then((res) => { + this.$store.commit("LOGIN", { + 'token': res.data.token + }); + this.getUserInfo(res.data); + }).catch(error => { + uni.hideLoading(); + uni.showModal({ + title: '提示', + content: `错误信息${error}`, + success: function(res) { + if (res.confirm) { + console.log('用户点击确定'); + } else if (res.cancel) { + console.log('用户点击取消'); + } + } + }); + }) + }, + // App微信登录 + wxLogin() { + let self = this + this.account = '' + this.captcha = '' + uni.showLoading({ + title: '登录中' + }) + uni.login({ + provider: 'weixin', + success: function(loginRes) { + // 获取用户信息 + uni.getUserInfo({ + provider: 'weixin', + success: function(infoRes) { + uni.hideLoading(); + self.appUserInfo = infoRes.userInfo + self.appUserInfo.type = self.platform === 'ios' ? 'iosWx' : 'androidWx' + self.wxLoginGo(self.appUserInfo) + }, + fail() { + uni.hideLoading(); + uni.showToast({ + title: '获取用户信息失败', + icon: 'none', + duration: 2000 + }) + }, + complete() { + uni.hideLoading() + } + }); + }, + fail() { + uni.hideLoading() + uni.showToast({ + title: '登录失败', + icon: 'none', + duration: 2000 + }) + } + }); + }, + wxLoginGo(userInfo) { + appAuth(userInfo).then(res => { + if (res.data.type === 'register') { + uni.navigateTo({ + url: '/pages/users/app_login/index?authKey='+res.data.key + }) + } + if (res.data.type === 'login') { + this.$store.commit("LOGIN", { + 'token': res.data.token + }); + this.getUserInfo(res.data); + } + }).catch(res => { + that.$util.Tips({ + title: res + }); + }); + }, again() { this.codeUrl = VUE_APP_API_URL + @@ -177,20 +269,11 @@ }, getCode() { let that = this - // getCodeApi() - // .then(res => { - // that.keyCode = res.data.key; - // }) - // .catch(res => { - // that.$util.Tips({ - // title: res - // }); - // }); }, async getLogoImage() { let that = this; getLogo().then(res => { - that.logoUrl = res.data.logoUrl; + that.logoUrl = res.data.logoUrl?res.data.logoUrl:'/static/images/logo2.png'; }); }, async loginMobile() { @@ -208,34 +291,17 @@ title: '请输入正确的验证码' }); loginMobile({ - account: that.account, + phone: that.account, captcha: that.captcha, - spread: that.$Cache.get("spread") + spread_spid: that.$Cache.get("spread") }) .then(res => { let data = res.data; let newTime = Math.round(new Date() / 1000); - that.$store.commit("LOGIN", { - 'token': data.token - // 'time': dayjs(data.expiresTime) - newTime + this.$store.commit("LOGIN", { + 'token': res.data.token }); - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; - that.$Cache.clear(BACK_URL); - // getUserInfo().then(res => { - that.$store.commit("SETUID", res.data.user.uid); - if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl === - '/pages/user/index') { - - uni.switchTab({ - url: backUrl - }); - - } else { - uni.switchTab({ - url: '/pages/index/index' - }); - } - // }) + that.getUserInfo(data); }) .catch(res => { that.$util.Tips({ @@ -290,21 +356,15 @@ title: '请输入正确的手机号码' }); if (that.formItem == 2) that.type = "register"; - // phone: that.account - // type: that.type, - // key: that.keyCode, - // code: that.codeVal await registerVerify(that.account) .then(res => { that.$util.Tips({title:res.message}); that.sendCode(); }) - .catch(res => { - // if (res.data.status === 402) { - // that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`; - // that.isShowCode = true; - // } - that.$util.Tips({title:res.message}); + .catch(err => { + return that.$util.Tips({ + title: err + }); }); }, navTap: function(index) { @@ -329,44 +389,210 @@ .then(({ data }) => { - // let newTime = Math.round(new Date() / 1000); - that.$store.commit("LOGIN", { + this.$store.commit("LOGIN", { 'token': data.token - // 'time': dayjs(data.expiresTime) - newTime }); - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; - that.$Cache.clear(BACK_URL); - getUserInfo().then(res => { - that.$store.commit("SETUID", res.data.uid); - if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ==='/pages/user/index') { - uni.switchTab({ - url: backUrl - }); - } else { - uni.switchTab({ - url: '/pages/index/index' - }); - } - }) + that.getUserInfo(data); }) .catch(e => { that.$util.Tips({ title: e }); }); + }, + getUserInfo(data){ + this.$store.commit("SETUID", data.uid); + getUserInfo().then(res => { + this.$store.commit("UPDATE_USERINFO", res.data); + let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index"; + if (backUrl.indexOf('/pages/users/login/index') !== -1) { + backUrl = '/pages/index/index'; + } + uni.reLaunch({ + url: backUrl + }); + }) } } }; - \ No newline at end of file + + .login-wrapper { + padding: 30rpx; + + .shading { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + + /* #ifdef APP-VUE */ + margin-top: 50rpx; + /* #endif */ + /* #ifndef APP-VUE */ + + margin-top: 200rpx; + /* #endif */ + + + image { + width: 180rpx; + height: 180rpx; + } + } + + .whiteBg { + margin-top: 100rpx; + + .list { + border-radius: 16rpx; + overflow: hidden; + + .item { + border-bottom: 1px solid #F0F0F0; + background: #fff; + + .row-middle { + position: relative; + padding: 16rpx 45rpx; + + .texts{ + flex: 1; + font-size: 28rpx; + height: 80rpx; + line-height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + } + + input { + flex: 1; + font-size: 28rpx; + height: 80rpx; + line-height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + } + + .code { + position: absolute; + right: 30rpx; + top: 50%; + color: $theme-color; + font-size: 26rpx; + transform: translateY(-50%); + } + } + } + } + + .logon { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 86rpx; + margin-top: 80rpx; + background-color: $theme-color; + border-radius: 120rpx; + color: #FFFFFF; + font-size: 30rpx; + } + + .tips { + margin: 30rpx; + text-align: center; + color: #999; + } + } + } + diff --git a/app/pages/users/order_confirm/index.vue b/app/pages/users/order_confirm/index.vue index 2af35f46..33043e6a 100644 --- a/app/pages/users/order_confirm/index.vue +++ b/app/pages/users/order_confirm/index.vue @@ -1,17 +1,23 @@ diff --git a/app/pages/users/promoter-list/index.vue b/app/pages/users/promoter-list/index.vue index 13eeff3f..7399028b 100644 --- a/app/pages/users/promoter-list/index.vue +++ b/app/pages/users/promoter-list/index.vue @@ -2,74 +2,84 @@ - + 推广人数 - {{teamCount}} + {{peopleData.count}} - - 一级({{total}}) - 二级({{totalLevel}}) - - - - - - - - 团队排序 - - - 团队排序 - - - 团队排序 - - - 金额排序 - - - 金额排序 - - - 金额排序 - - - 订单排序 - - - 订单排序 - - - 订单排序 - + + + 一级({{peopleData.total}}) + 二级({{peopleData.totalLevel}}) - - - - - - - - {{item.nickname}} - 加入时间: {{item.time}} - + + + + + + + 团队排序 + - - {{item.childCount ? item.childCount : 0}} - {{item.orderCount ? item.orderCount : 0}} - {{item.numberCount ? item.numberCount : 0}} + 团队排序 + + + 团队排序 + + + + 金额排序 + + + 金额排序 + + + 金额排序 + + + 订单排序 + + + 订单排序 + + + 订单排序 + - + + + + + + + + {{item.nickname}} + 加入时间: {{item.time.split(' ')[0]}} + + + + {{item.childCount ? item.childCount : 0}}人 + + {{item.orderCount ? item.orderCount : 0}} + {{item.numberCount ? item.numberCount : 0}} + + + + + + + + - + @@ -77,7 +87,8 @@ diff --git a/app/pages/users/user_address_list/index.vue b/app/pages/users/user_address_list/index.vue index e7753d25..2b78887a 100644 --- a/app/pages/users/user_address_list/index.vue +++ b/app/pages/users/user_address_list/index.vue @@ -1,11 +1,11 @@ @@ -117,8 +117,7 @@ import { extractCash, extractBank, - getUserInfo, - brokerageCommission + extractUser } from '@/api/user.js'; import { toLogin @@ -169,8 +168,8 @@ isLogin:{ handler:function(newV,oldV){ if(newV){ - this.getUserInfo(); this.getUserExtractBank(); + this.getExtractUser(); } }, deep:true @@ -178,17 +177,10 @@ }, onLoad() { if (this.isLogin) { - this.getUserInfo(); this.getUserExtractBank(); - //this.getBrokerageCommission(); + this.getExtractUser(); } else { - // #ifdef H5 || APP-PLUS toLogin(); - // #endif - // #ifdef MP - this.isAuto = true; - this.$set(this, 'isShowAuth', true); - // #endif } }, methods: { @@ -218,13 +210,12 @@ this.qrcodeUrlZ = ""; }, onLoadFun: function() { - this.getUserInfo(); this.getUserExtractBank(); - // this.getBrokerageCommission(); }, - getBrokerageCommission: function(){ - brokerageCommission().then(res=>{ + getExtractUser(){ + extractUser().then(res=>{ this.commission = res.data; + this.minPrice = res.data.minPrice; }) }, // 授权关闭 @@ -234,20 +225,9 @@ getUserExtractBank: function() { let that = this; extractBank().then(res => { - let array = res.data.extractBank; + let array = res.data; array.unshift("请选择银行"); that.$set(that, 'array', array); - that.minPrice = res.data.minPrice; - that.commission = res.data; - }); - }, - /** - * 获取个人用户信息 - */ - getUserInfo: function() { - let that = this; - getUserInfo().then(res => { - that.userInfo = res.data; }); }, swichNav: function(current) { @@ -256,6 +236,15 @@ bindPickerChange: function(e) { this.index = e.detail.value; }, + moneyInput(e) { + //正则表达试 + e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null + //重新赋值给input + this.$nextTick(() => { + this.money= e.target.value + }) + + }, subCash: function(e) { let that = this, value = e.detail.value; @@ -289,13 +278,15 @@ if (value.money.length == 0) return this.$util.Tips({ title: '请填写提现金额' }); + if (!(/^(\d?)+(\.\d{0,2})?$/.test(value.money))) return this.$util.Tips({ + title: '提现金额保留2位小数' + }); if (value.money < that.minPrice) return this.$util.Tips({ title: '提现金额不能低于' + that.minPrice }); if(this.isCommitted==false){ this.isCommitted=true; extractCash(value).then(res => { - that.getUserInfo(); return this.$util.Tips({ title: "提现成功", icon: 'success' @@ -337,7 +328,7 @@ width: 40rpx; height: 40rpx; border-radius: 50%; - border: 2rpx solid #e93323; + border: 2rpx solid $theme-color; text-align: center; line-height: 37rpx; margin: 0 auto 6rpx auto; @@ -346,9 +337,9 @@ } .cash-withdrawal .nav .item .iconfont.on { - background-color: #e93323; + background-color: $theme-color; color: #fff; - border-color: #e93323; + border-color: $theme-color; } .cash-withdrawal .nav .item .line { diff --git a/app/pages/users/user_coupon/index.vue b/app/pages/users/user_coupon/index.vue index 776c8a4a..662e4368 100644 --- a/app/pages/users/user_coupon/index.vue +++ b/app/pages/users/user_coupon/index.vue @@ -1,5 +1,9 @@