diff --git a/pages/copyright/createBuy/createBuy.js b/pages/copyright/createBuy/createBuy.js index f5dffbf..9dddfe7 100644 --- a/pages/copyright/createBuy/createBuy.js +++ b/pages/copyright/createBuy/createBuy.js @@ -11,6 +11,8 @@ Page({ allPrice: 0, materialPrice: 0, isUrgent: false, //是否加急 + showSuccess: false, + successHint: '' }, /** @@ -85,5 +87,21 @@ Page({ wx.navigateTo({ url: '../createProjectInfo/createProjectInfo?type=' + type + '&price=' + price + '&isUrgent=' + urgent }) + }, + //点击复制 + copyLink() { + const _self = this + wx.setClipboardData({ + data: 'https://www.aimzhu.com', + success: () => { + _self.setData({ + successHint: '复制成功', + showSuccess: true + }) + }, + fail: err => { + console.log(err) + } + }) } }) \ No newline at end of file diff --git a/pages/copyright/createBuy/createBuy.json b/pages/copyright/createBuy/createBuy.json index 3928faa..0466261 100644 --- a/pages/copyright/createBuy/createBuy.json +++ b/pages/copyright/createBuy/createBuy.json @@ -1,3 +1,3 @@ { - "usingComponents": {} + "usingComponents": {"mp-toptips": "weui-miniprogram/toptips/toptips"} } \ No newline at end of file diff --git a/pages/copyright/createBuy/createBuy.wxml b/pages/copyright/createBuy/createBuy.wxml index afd3f4d..47540a0 100644 --- a/pages/copyright/createBuy/createBuy.wxml +++ b/pages/copyright/createBuy/createBuy.wxml @@ -73,13 +73,13 @@ - + @@ -148,11 +148,12 @@ - + 免费试用请使用电脑端登录 - www.aimzhu.com + https://www.aimzhu.com - \ No newline at end of file + + \ No newline at end of file diff --git a/pages/copyright/createProjectInfo/createProjectInfo.js b/pages/copyright/createProjectInfo/createProjectInfo.js index d21b2d4..0943a3f 100644 --- a/pages/copyright/createProjectInfo/createProjectInfo.js +++ b/pages/copyright/createProjectInfo/createProjectInfo.js @@ -25,7 +25,6 @@ Page({ tempCoupons: {}, //临时选中的优惠卷,没有点击确定按钮 contactList: [], //联系人 selectContact: {}, //当前选中的联系人 - showCreateContact: false, //显示创建联系人 contactPhone: '', //联系人电话 contactName: '', //联系人姓名 contactEmail: '', //联系人邮箱 @@ -47,6 +46,10 @@ Page({ tempLang: '', //临时选中的语言 selectLang: '', contactCompany: '', //联系人公司 + isShowUrgent: true, //是否加急 + urgent: 0, //加急费用 + isUrgentDisable: false, //是否禁用加急 + proPrice: 0, //价格 }, onLoad(options) { wx.setNavigationBarTitle({ @@ -63,9 +66,11 @@ Page({ const typeParams = options.type //类型 const priceParams = options.price //价格 const isUrgentParams = options.isUrgent + console.log(priceParams) if (priceParams && priceParams > 0) { this.setData({ price: priceParams, + proPrice: priceParams, type: typeParams, isUrgent: isUrgentParams }) @@ -76,6 +81,15 @@ Page({ }) wx.navigateBack() } + if (this.data.type == 'ALL') { + this.setData({ + isShowUrgent: true + }) + } else { + this.setData({ + isShowUrgent: false + }) + } //获取项目联系人 this.doGetContactList() //获取套餐包 @@ -86,6 +100,30 @@ Page({ this.doGetCsaNo(false) //获取可选语言 this.doGetProLangList() + //获取加急等费用 + this.doGetPrice() + }, + //获取单价 + doGetPrice() { + wx.showLoading({ + title: '加载中...', + }) + const _self = this + ProjectService.doGetPrice() + .then(res => { + console.log(res) + _self.setData({ + urgent: res.additional.urgent, //加急办理 + }) + }, err => { + wx.showToast({ + title: '数据有误,请稍后重试', + icon: 'error', + success: () => { + wx.navigateBack() + } + }) + }) }, //系统版本 inputVersion(e) { @@ -94,6 +132,22 @@ Page({ version: e.detail.value }) }, + //是否加急 + doUrgent() { + const _self = this + _self.setData({ + isUrgent: !_self.data.isUrgent + }) + var newPrice = Number(_self.data.price) + if (_self.data.isUrgent) { + newPrice = Number(_self.data.price) + Number(_self.data.urgent) + } else { + newPrice = Number(_self.data.price) - Number(_self.data.urgent) + } + _self.setData({ + price: newPrice + }) + }, //开发完成时间 bindDateChange(e) { console.log(e) @@ -168,14 +222,19 @@ Page({ }, //确定使用选中的优惠卷 confirmSelCoupons() { - this.setData({ - selectCoupons: this.data.tempCoupons, + const _self = this + _self.setData({ + selectCoupons: _self.data.tempCoupons, showCoupons: false, tempCoupons: {}, canSelPackage: false, selectPackage: {}, tempPackage: {} }) + var newPrice = Number(_self.data.price) - Number(_self.data.selectCoupons.coupon.amount) + _self.setData({ + price: newPrice > 0 ? newPrice : 0 + }) }, //监听项目名称 inputProjectName(e) { @@ -305,7 +364,10 @@ Page({ tempPackage: {}, canSelCoupons: false, selectCoupons: {}, - tempCoupons: {} + tempCoupons: {}, + isUrgent: false, //取消加急 + isUrgentDisable: true, //加急不能选择 + price: 0 }) }, //取消选中的套餐包或优惠卷 @@ -316,7 +378,10 @@ Page({ tempCoupons: {}, tempPackage: {}, canSelCoupons: true, - canSelPackage: true + canSelPackage: true, + isUrgent: false, //取消加急 + isUrgentDisable: false, //加急可以选择 + price: this.data.proPrice, //重置价格 }) }, //点击选择套餐包 @@ -403,7 +468,7 @@ Page({ _self.doGetCsaNo(true) } else { _self.setData({ - showCreateContact: true + isShowContact: true }) } }, @@ -434,18 +499,18 @@ Page({ return } } + const data = { + company: _self.data.contactCompany, + csaNo: _self.data.csaNo, + name: _self.data.contactName, + phone: _self.data.contactPhone, + email: _self.data.email + } wx.showLoading({ title: '创建中...', }) - const data = { - "company": _self.data.contactCompany, - "csaNo": _self.data.csaNo, - "name": _self.data.contactName, - "phone": _self.data.contactPhone - } UserService.doCreateContact(data) .then(res => { - wx.hideLoading() _self.setData({ showSuccess: true, successHint: '新建成功', @@ -453,18 +518,22 @@ Page({ contactEmail: '', contactPhone: '', contactName: '', - contactCompany:'', + contactCompany: '', }) //获取一遍联系人 _self.doGetContactList() - }, err => { - wx.hideLoading() + }) + .catch(err => { _self.setData({ showError: true, errorHint: err.msg ? err.msg : '新建失败,请稍后重试', isShowContact: false }) }) + .finally(() => { + console.log('finally') + wx.hideLoading() + }) }, //创建项目 doCreateProject() { diff --git a/pages/copyright/createProjectInfo/createProjectInfo.wxml b/pages/copyright/createProjectInfo/createProjectInfo.wxml index a013d00..d3a858f 100644 --- a/pages/copyright/createProjectInfo/createProjectInfo.wxml +++ b/pages/copyright/createProjectInfo/createProjectInfo.wxml @@ -45,7 +45,7 @@ 开发完成时间 - {{completeDate}} + {{completeDate}} @@ -69,32 +69,37 @@ - 金额: - {{price/100}}元 + + 金额:{{price/100}}元 + + + 加急办理{{urgent/100}}元 + + 保存并付款 - + 创建联系人 姓名 - + 联系电话 - + 联系邮箱 - + 公司 - + @@ -108,11 +113,13 @@ - - - {{item}} - - + + + + {{item}} + + + diff --git a/pages/copyright/createProjectInfo/createProjectInfo.wxss b/pages/copyright/createProjectInfo/createProjectInfo.wxss index 09c7c73..adeb8bd 100644 --- a/pages/copyright/createProjectInfo/createProjectInfo.wxss +++ b/pages/copyright/createProjectInfo/createProjectInfo.wxss @@ -4,6 +4,38 @@ page { background-repeat: no-repeat; } +.custom-checkbox { + font-size: 14px; + margin-left: 14px; +} + +.custom-wx-checkbox .wx-checkbox-input.wx-checkbox-input-checked { + color: #fff !important; + background-color: #FFA900; + border: 1px solid #FFA900; +} + +.custom-wx-checkbox .wx-checkbox-input { + -webkit-appearance: none; + appearance: none; + margin-bottom: 3px; + outline: 0; + text-indent: 0; + width: 32rpx; + height: 32rpx; + background-color: transparent; + position: relative; + border: 1rpx solid #FFA900; + box-sizing: border-box; + text-align: center; +} + +/*钩大小*/ +.custom-wx-checkbox .wx-checkbox-input.wx-checkbox-input-checked:before { + font-size: 32rpx; + text-align: center; +} + .create-container { display: flex; flex-direction: column; @@ -168,6 +200,8 @@ page { .bottom-box .money { color: #532A00; font-size: 20px; + display: flex; + flex-direction: row; } .price { diff --git a/pages/index/index.js b/pages/index/index.js index 2a98737..1942ed9 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -460,7 +460,6 @@ Page({ _self.setData({ successHint: '本次领取操作已成功,您可以在 “我的” 页面查看相关信息。', showSuccess: true, - showAd: false }) }) .catch(err => { @@ -468,7 +467,6 @@ Page({ _self.setData({ errorHint: err.msg ? err.msg : '本次领取操作未成功,请重新进入小程序后再次尝试。', showError: true, - showAd: false }) }) } diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 4f25c89..136e7a6 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -249,7 +249,7 @@ .project-status { font-size: 12px; - color: #FE9944; + color: rgba(16, 16, 16, 1); font-weight: 400; flex: .3; padding-left: 5px; diff --git a/pages/mine/mineAccount/mineCoupons/mineCoupons.wxml b/pages/mine/mineAccount/mineCoupons/mineCoupons.wxml index 6187e0c..60087d3 100644 --- a/pages/mine/mineAccount/mineCoupons/mineCoupons.wxml +++ b/pages/mine/mineAccount/mineCoupons/mineCoupons.wxml @@ -35,7 +35,7 @@ {{item.coupon.title}} - {{item.coupon.useGmtStart}}-{{item.coupon.useGmtEnd}} + {{tools.timeSplit(item.coupon.useGmtStart)}}-{{tools.timeSplit(item.coupon.useGmtEnd)}} diff --git a/pages/mine/mineAccount/mineCoupons/mineCoupons.wxss b/pages/mine/mineAccount/mineCoupons/mineCoupons.wxss index a742b8c..6f85d89 100644 --- a/pages/mine/mineAccount/mineCoupons/mineCoupons.wxss +++ b/pages/mine/mineAccount/mineCoupons/mineCoupons.wxss @@ -125,7 +125,7 @@ page { display: flex; flex-direction: row; justify-content: center; - align-items: flex-end; + align-items: baseline; padding: 10px; } diff --git a/pages/mine/mineAccount/mineOrder/mineOrder.wxml b/pages/mine/mineAccount/mineOrder/mineOrder.wxml index 5148990..c6960bb 100644 --- a/pages/mine/mineAccount/mineOrder/mineOrder.wxml +++ b/pages/mine/mineAccount/mineOrder/mineOrder.wxml @@ -8,7 +8,7 @@ - + @@ -21,8 +21,8 @@ {{tools.proType(detail.productType)}} 数量{{detail.quantity}} - 单价{{detail.unitPrice}} - 总金额{{item.totalAmount}} + 单价{{detail.unitPrice/100}} + 总金额{{item.totalAmount/100}} 订单备注 diff --git a/utils/comm.wxs b/utils/comm.wxs index f393a8d..889c106 100644 --- a/utils/comm.wxs +++ b/utils/comm.wxs @@ -97,6 +97,10 @@ var fontColor = function (value) { } return str } +var timeSplit = function (value) { + var regex = getRegExp('-', 'g'); + return value.replace(regex, '.') +} module.exports = { isEmpty: isEmpty, @@ -104,5 +108,6 @@ module.exports = { orderStatus: orderStatus, proType: proType, boderStyle: boderStyle, - fontColor: fontColor + fontColor: fontColor, + timeSplit: timeSplit }; \ No newline at end of file