From 18a2fbb8a63894013cabeb81344490b1fbb9b855 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Mon, 25 Dec 2023 17:16:56 +0800 Subject: [PATCH] =?UTF-8?q?Feat:=E4=BC=98=E6=83=A0=E5=88=B8=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.js | 251 +++++++++--------- api/wenwan.js | 2 +- assets/css/goods.less | 24 +- assets/script/global.js | 36 ++- components/Coupons.vue | 129 +++++++++ components/CouponsPopup.vue | 128 +++++++++ components/ProductWindow.vue | 4 - components/SubSection.vue | 73 +++++ components/chose-city/chose-city.vue | 222 ++++++++++++++-- config/index.js | 25 +- package.json | 31 ++- pages.json | 45 ++-- pages/cloud/haveFun.vue | 1 - pages/home/index.vue | 49 +++- pages/home/landMark.vue | 3 +- pages/order/OrderDetails/index.vue | 2 +- pages/order/OrderSubmission/index.vue | 248 +++++------------ pages/shop/GoodsCon/index.vue | 141 ++++------ pages/shop/ShoppingCart/index.vue | 36 +-- pages/user/User/index.vue | 49 +--- pkg_product/views/nativeList.vue | 3 +- pkg_user/views/myCoupons.vue | 105 ++++++++ uni_modules/uview-ui/LICENSE | 4 +- uni_modules/uview-ui/changelog.md | 7 +- .../uview-ui/components/u-button/u-button.vue | 2 +- .../uview-ui/components/u-calendar/header.vue | 4 +- .../uview-ui/components/u-calendar/month.vue | 64 +---- .../components/u-calendar/u-calendar.vue | 1 - .../uview-ui/components/u-cell/u-cell.vue | 2 +- .../uview-ui/components/u-icon/icons.js | 2 +- .../uview-ui/components/u-icon/u-icon.vue | 14 +- .../uview-ui/components/u-modal/u-modal.vue | 4 +- .../uview-ui/components/u-navbar/props.js | 7 - .../uview-ui/components/u-navbar/u-navbar.vue | 17 +- .../uview-ui/components/u-popup/u-popup.vue | 2 +- .../uview-ui/components/u-radio/u-radio.vue | 4 +- .../components/u-tabbar-item/props.js | 4 - .../u-tabbar-item/u-tabbar-item.vue | 2 +- .../uview-ui/components/u-text/props.js | 2 +- uni_modules/uview-ui/libs/config/config.js | 4 +- uni_modules/uview-ui/libs/function/index.js | 94 ++++--- uni_modules/uview-ui/libs/util/route.js | 214 +++++++-------- uni_modules/uview-ui/package.json | 2 +- uni_modules/uview-ui/theme.scss | 4 +- utils/request.js | 146 +++++----- wenwan/views/storeList.vue | 5 +- 46 files changed, 1360 insertions(+), 858 deletions(-) create mode 100644 components/Coupons.vue create mode 100644 components/CouponsPopup.vue create mode 100644 components/SubSection.vue create mode 100644 pkg_user/views/myCoupons.vue diff --git a/api/user.js b/api/user.js index 13b9bb9..915083b 100644 --- a/api/user.js +++ b/api/user.js @@ -4,16 +4,16 @@ import request from "@/utils/request"; * 省市区 */ export function getCity(data) { - return request.get("/city_list", data, { - login: false - }); + return request.get("/city_list", data, { + login: false + }); } export function district(data) { - // return request.get("/city_list", data, { - return request.get("/citys", data, { - login: false - }); + // return request.get("/city_list", data, { + return request.get("/citys", data, { + login: false + }); } /** @@ -21,9 +21,9 @@ export function district(data) { * @param data object 用户账号密码 */ export function login(data) { - return request.post("/login", data, { - login: false - }); + return request.post("/login", data, { + login: false + }); } /** @@ -31,9 +31,9 @@ export function login(data) { * @param data object 用户手机号 也只能 */ export function loginMobile(data) { - return request.post("/login/mobile", data, { - login: false - }); + return request.post("/login/mobile", data, { + login: false + }); } /** @@ -41,9 +41,9 @@ export function loginMobile(data) { * @param data object 用户手机号 */ export function registerVerify(data) { - return request.post("/register/verify", data, { - login: false - }); + return request.post("/register/verify", data, { + login: false + }); } /** @@ -51,9 +51,9 @@ export function registerVerify(data) { * @param data object 用户手机号 验证码 密码 */ export function register(data) { - return request.post("/register", data, { - login: false - }); + return request.post("/register", data, { + login: false + }); } /** @@ -61,9 +61,9 @@ export function register(data) { * @param data object 用户手机号 验证码 密码 */ export function registerReset(data) { - return request.post("/register/reset", data, { - login: false - }); + return request.post("/register/reset", data, { + login: false + }); } /** @@ -71,7 +71,7 @@ export function registerReset(data) { * @param nil */ export function userBindParent(data) { - return request.post("/user/spread", data); + return request.post("/user/spread", data); } /** @@ -79,7 +79,7 @@ export function userBindParent(data) { * @param nil */ export function getUserLevelInfo() { - return request.get("/user/levelInfo"); + return request.get("/user/levelInfo"); } /** @@ -87,7 +87,7 @@ export function getUserLevelInfo() { * @param nil */ export function saveUserProtocol(data) { - return request.post("/user/saveGd", data); + return request.post("/user/saveGd", data); } @@ -95,343 +95,346 @@ export function saveUserProtocol(data) { * 视频回放列表 * */ export function getVideoList(q) { - return request.get("/video_list", q, { - login: false - }); + return request.get("/video_list", q, { + login: false + }); } - /* * 领取优惠券列表 * */ export function getCoupon(q) { - return request.get("/coupons", q, { - login: true - }); + return request.get("/coupons", q, { + login: true + }); } /* * 点击领取优惠券 + * v9-2在用 * */ export function getCouponReceive(id) { - return request.post("/coupon/receive", { - couponId: id - }, { - login: true - }); + return request.post("/coupon/receive", { + couponId: id + }, { + login: true + }); } /* * 批量领取优惠券 * */ export function couponReceiveBatch(couponId) { - return request.post("/coupon/receive/batch", { - couponId - }); + return request.post("/coupon/receive/batch", { + couponId + }); } /* * 我的优惠券 + * v9-2在用 * */ export function getCouponsUser(type) { - return request.get("/coupons/user/" + type); + let url = '/coupons/user' + if (type !== undefined && type !== null) url += `?filterType=${type}` + return request.get(url) } /* * 个人中心 * */ export function getUser() { - return request.get("/user"); + return request.get("/user"); } /* * 用户信息 * */ export function getUserInfo() { - return request.get("/userinfo", { - login: true - }); + return request.get("/userinfo", { + login: true + }); } /* * 小程序检查授权 * */ export function wxappCheckAuth(data) { - return request.post("/wxapp/checkAuthCode", data, { - login: false - }); + return request.post("/wxapp/checkAuthCode", data, { + login: false + }); } /* * 小程序登陆 * */ export function wxappAuth(data) { - return request.post("/wxapp/auth", data, { - login: false - }); + return request.post("/wxapp/auth", data, { + login: false + }); } /* * 个人中心(功能列表) * */ export function getMenuUser() { - return request.get("/menu/user"); + return request.get("/menu/user"); } /* * 用户设置支付密码 * */ export function setUserPayPwd(data) { - return request.post("/user/savePayPass", data); + return request.post("/user/savePayPass", data); } /* * 通知消息列表 * */ export function noticeList(data) { - return request.get("/platNoticeSend/list", data, { login: true }); + return request.get("/platNoticeSend/list", data, {login: true}); } /* * 通知消息详情 * */ export function noticeDetail(data) { - return request.post("/platNoticeSend/read", data, { login: true }); + return request.post("/platNoticeSend/read", data, {login: true}); } /* * 用户修改支付密码 * */ export function modifyUserPayPwd(data) { - return request.post("/user/updatePayPass", data); + return request.post("/user/updatePayPass", data); } export function bankList(data) { - return request.get("/api/yxBank/bank/list", data, { login: true }); + return request.get("/api/yxBank/bank/list", data, {login: true}); } export function bankCardList(data) { - return request.get("/api/yxBankCard/bankCard/list", data, { login: true }); + return request.get("/api/yxBankCard/bankCard/list", data, {login: true}); } export function addBankCard(data) { - return request.post("/api/yxBankCard/bankCard/add", data, { login: true }); + return request.post("/api/yxBankCard/bankCard/add", data, {login: true}); } export function deleteBankCard(data) { - return request.post("/api/yxBankCard/bankCard/del", data, { login: true }); + return request.post("/api/yxBankCard/bankCard/del", data, {login: true}); } /* * 地址列表 * */ export function getAddressList(data) { - return request.get("/address/list", data || {}); + return request.get("/address/list", data || {}); } /* * 删除地址 * */ export function getAddressRemove(id) { - return request.post("/address/del", { - id: id - }); + return request.post("/address/del", { + id: id + }); } /* * 设置默认地址 * */ export function getAddressDefaultSet(id) { - return request.post("/address/default/set", { - id: id - }); + return request.post("/address/default/set", { + id: id + }); } /* * 获取默认地址 * */ export function getAddressDefault() { - return request.get("/address/default"); + return request.get("/address/default"); } /* * 获取单个地址 * */ export function getAddress(id) { - return request.get("/address/detail/" + id); + return request.get("/address/detail/" + id); } /* * 修改 添加地址 * */ export function postAddress(data) { - return request.post("/address/edit", data); + return request.post("/address/edit", data); } /* * 获取收藏产品 * */ export function getCollectUser(page, limit) { - return request.get("/collect/user", { - page: page, - limit: limit - }); + return request.get("/collect/user", { + page: page, + limit: limit + }); } /* * 删除收藏产品 * */ export function getCollectDel(id, category) { - return request.post("/collect/del", { - id: id, - category: category - }); + return request.post("/collect/del", { + id: id, + category: category + }); } /* * 批量收藏产品 * */ export function postCollectAll(data) { - return request.post("/collect/all", data); + return request.post("/collect/all", data); } /* * 添加收藏产品 * */ export function getCollectAdd(id, category) { - return request.post("collect/add", { - id: id, - category: category - }); + return request.post("collect/add", { + id: id, + category: category + }); } /* * 签到配置 * */ export function getSignConfig() { - return request.get("/sign/config"); + return request.get("/sign/config"); } /* * 签到里的签到列表 * */ export function getSignList(page, limit) { - return request.get("/sign/list", { - page: page, - limit: limit - }); + return request.get("/sign/list", { + page: page, + limit: limit + }); } /* * 签到列表 * */ export function getSignMonth(page, limit) { - return request.get("/sign/month", { - page: page, - limit: limit - }); + return request.get("/sign/month", { + page: page, + limit: limit + }); } /* * 签到用户信息 * */ export function postSignUser(sign) { - return request.post("/sign/user", sign); + return request.post("/sign/user", sign); } /* * 签到 * */ export function postSignIntegral(sign) { - return request.post("/sign/integral", sign); + return request.post("/sign/integral", sign); } /* * 推广数据 * */ export function getSpreadInfo() { - return request.get("/commission"); + return request.get("/commission"); } /* * 推广人列表 * */ export function getSpreadUser(screen) { - return request.post("/spread/people", screen); + return request.post("/spread/people", screen); } /* * 推广人订单 * */ export function getSpreadOrder(where) { - return request.post("/spread/order", where); + return request.post("/spread/order", where); } /* * 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现) * */ export function getCommissionInfo(q, types) { - return request.get("/spread/commission/" + types, q); + return request.get("/spread/commission/" + types, q); } /* * 积分记录 * */ export function getIntegralList(q) { - return request.get("/integral/list", q); + return request.get("/integral/list", q); } /* * 提现记录 * */ export function getWithdrawalRecordList(q) { - return request.get("/list", q); + return request.get("/list", q); } /* * 提现银行 * */ export function getBank() { - return request.get("/extract/bank"); + return request.get("/extract/bank"); } /* * 提现申请 * */ export function postCashInfo(cash) { - return request.post("/extract/cash", cash); + return request.post("/extract/cash", cash); } /* * 会员中心 * */ export function getVipInfo() { - return request.get("/user/level/grade"); + return request.get("/user/level/grade"); } /* * 会员等级任务 * */ export function getVipTask(id) { - return request.get("/user/level/task/" + id); + return request.get("/user/level/task/" + id); } /* * 资金统计 * */ export function getBalance() { - return request.get("/user/balance"); + return request.get("/user/balance"); } /* * 活动状态 * */ export function getActivityStatus() { - return request.get("/user/activity", {}, { - login: false - }); + return request.get("/user/activity", {}, { + login: false + }); } /* @@ -439,87 +442,89 @@ export function getActivityStatus() { * */ export function getSpreadImg(data) { - return request.get("/spread/banner", data); + return request.get("/spread/banner", data); } /* * 用户修改信息 * */ export function postUserEdit(data) { - return request.post("/user/edit", data); + return request.post("/user/edit", data); } /* * 用户修改信息 * */ export function getChatRecord(to_uid, data) { - return request.get("user/service/record/" + to_uid, data); + return request.get("user/service/record/" + to_uid, data); } /* * 用户修改信息 * */ export function serviceList() { - return request.get("user/service/list"); + return request.get("user/service/list"); } /* * 公众号充值 * */ export function rechargeWechat(data) { - return request.post("/recharge/wechat", data); + return request.post("/recharge/wechat", data); } /* * 退出登录 * */ export function getLogout() { - return request.post("/auth/logout"); + return request.post("/auth/logout"); } /* * 绑定手机号(小程序方式) * */ export function bindingPhone(data) { - return request.post("wxapp/binding", data); + return request.post("wxapp/binding", data); } /* * 绑定手机号(手机号,验证码方式) * */ export function bindingPhoneByInput(data) { - return request.post("/binding", data); + return request.post("/binding", data); } /* * h5切换公众号登陆 * */ export function switchH5Login() { - return request.post("switch_h5", { - from: "wechat" - }); + return request.post("switch_h5", { + from: "wechat" + }); } + /* * 获取推广人排行 * */ export function getRankList(q) { - return request.get("rank", q); + return request.get("rank", q); } + /* * 获取佣金排名 * */ export function getBrokerageRank(q) { - return request.get("brokerage_rank", q); + return request.get("brokerage_rank", q); } /** * 检测会员等级 */ export function setDetection() { - return request.get("user/level/detection"); + return request.get("user/level/detection"); } export function getRechargeApi() { - return request.get("recharge/index"); + return request.get("recharge/index"); } diff --git a/api/wenwan.js b/api/wenwan.js index 907a642..a7d5a91 100644 --- a/api/wenwan.js +++ b/api/wenwan.js @@ -16,6 +16,6 @@ export function fetchStore(page, cityName, name) { * */ export function fetchCity(type) { return request.get(`/wenwan/cityList/${type}`, {}, { - login: false + login: true }) } diff --git a/assets/css/goods.less b/assets/css/goods.less index c25509c..8c575ba 100644 --- a/assets/css/goods.less +++ b/assets/css/goods.less @@ -74,6 +74,19 @@ .cell:last-child { margin-bottom: 0; } + + .coupon-label { + display: inline-block; + height: 46rpx; + box-sizing: border-box; + margin-right: 10rpx; + padding: 0 8rpx; + border: 2rpx solid #FD5749; + border-radius: 8rpx; + color: #FD5749; + font-size: 28rpx; + line-height: 46rpx; + } } .store-section { @@ -111,14 +124,15 @@ height: 198rpx; overflow: hidden; - .tag{ + .tag { position: absolute; top: 0; left: 0; width: 92rpx; height: 40rpx; } - .cover{ + + .cover { width: 100%; height: 100%; border-radius: 12rpx; @@ -162,12 +176,14 @@ color: #ADADAD; } } - .row:last-child{ + + .row:last-child { border-bottom: none; } + .value { width: 100%; padding: 16rpx; } } -} +} \ No newline at end of file diff --git a/assets/script/global.js b/assets/script/global.js index 67d1614..0f263e9 100644 --- a/assets/script/global.js +++ b/assets/script/global.js @@ -26,6 +26,15 @@ export default { } }, + levelJump: (level, url, params) => { + if (params) url += `?${params}` + if (level === 1) { + uni.switchTab({url}) + } else { + uni.navigateTo({url}) + } + }, + navToGoods: (id) => { uni.navigateTo({ url: "/pages/shop/GoodsCon/index?id=" + id @@ -36,14 +45,14 @@ export default { uni.navigateToMiniProgram({ appId: "wx9ca93d1f2a9c8156", path: "pages/auth/login", - success(msg){ - console.log("success",msg) + success(msg) { + console.log("success", msg) }, - fail(err){ - console.log("fail",err) + fail(err) { + console.log("fail", err) }, - complete(msg){ - console.log("complete",msg) + complete(msg) { + console.log("complete", msg) } }) }, @@ -68,6 +77,21 @@ export default { res += chars[id]; } return res; + }, + + deepClone(val) { + let oVal = Array.isArray(val) ? [] : {}; + for (let v in val) { + if (val.hasOwnProperty(v)) { + if ('object' === typeof val[v]) { + //这里是深拷贝的关键所在(递归调用) + oVal[v] = this.deepClone(val[v]); + } else { + oVal[v] = val[v]; + } + } + } + return oVal; } } diff --git a/components/Coupons.vue b/components/Coupons.vue new file mode 100644 index 0000000..8a4ec3c --- /dev/null +++ b/components/Coupons.vue @@ -0,0 +1,129 @@ + + + + + \ No newline at end of file diff --git a/components/CouponsPopup.vue b/components/CouponsPopup.vue new file mode 100644 index 0000000..f2be69a --- /dev/null +++ b/components/CouponsPopup.vue @@ -0,0 +1,128 @@ + + + + + \ No newline at end of file diff --git a/components/ProductWindow.vue b/components/ProductWindow.vue index e1f954c..a0b1065 100644 --- a/components/ProductWindow.vue +++ b/components/ProductWindow.vue @@ -65,9 +65,6 @@ export default { data: function() { return {}; }, - mounted: function() { - console.log(this); - }, methods: { previewImg:function(imgUrl){ uni.previewImage({ @@ -107,7 +104,6 @@ export default { getCheckedValue: function() { let productAttr = this.attr.productAttr; let value = []; - // console.log(productAttr) for (let i = 0; i < productAttr.length; i++) { for (let j = 0; j < productAttr[i].attrValueArr.length; j++) { if (productAttr[i].index === j) { diff --git a/components/SubSection.vue b/components/SubSection.vue new file mode 100644 index 0000000..1a4c867 --- /dev/null +++ b/components/SubSection.vue @@ -0,0 +1,73 @@ + + + + + \ No newline at end of file diff --git a/components/chose-city/chose-city.vue b/components/chose-city/chose-city.vue index 72dd320..51c3395 100644 --- a/components/chose-city/chose-city.vue +++ b/components/chose-city/chose-city.vue @@ -19,29 +19,68 @@ @up="upCallback" @down="downCallback" @init="mescrollInit" @emptyclick="emptyClick"> - + - 当前定位:{{ location }} - + 当前定位:{{ location }} + 定位失败 + + - - 特别推荐 - - - 暂无特产 - 暂无店铺 - - {{ item.cityName }} - - - + + + + + + + + + + + - {{ provinceName }} + + + + + + + {{ provinceName }} 暂无特产 @@ -102,7 +141,8 @@ export default { keyword: "", type: null, location: "", - banner: {} + banner: {}, + recommendInfo: null, // 推荐信息 }; }, onLoad(options) { @@ -114,11 +154,50 @@ export default { this.init(); }, methods: { + reload() { + uni.getSetting({ + success(res) { + if (res.authSetting['scope.userLocation']) { + + } else { + uni.showModal({ + title: '提示', + content: '当前定位未开启,请点击确定手动开启定位', + duration: 5000, + success(result) { + if (result.confirm) { + uni.openSetting({ + success(openRes) { + if (openRes.authSetting['scope.userLocation']) { + + } else { + uni.showToast({ + title: '你拒绝了授权,无法继续', + icon: 'none' + }) + } + } + }) + } else if (result.cancel) { + uni.showToast({ + title: '你拒绝了授权,无法获取定位信息', + icon: 'none' + }) + } + } + }) + } + } + }) + }, + async getMapData() { const map = await getLocation(); - const {latitude, longitude} = map[1]; - const address = await getCurAddress(latitude, longitude); - this.location = address[1].data.result.ad_info.city; + if (map) { + const {latitude, longitude} = map[1]; + const address = await getCurAddress(latitude, longitude); + this.location = address[1].data.result.ad_info.city; + } }, init() { @@ -130,6 +209,7 @@ export default { this.listTop = this.listGroup[0].top; this.listCity = this.listGroup[0].city; this.provinceName = this.listGroup[0].label; + this.recommendInfo = this.listGroup[0].recommendInfo this.banner = { icon: this.listGroup[0].icon, url: this.listGroup[0].uniappUrl @@ -143,6 +223,7 @@ export default { this.listTop = this.listGroup[index].top; this.listCity = this.listGroup[index].city; this.provinceName = this.listGroup[index].label; + this.recommendInfo = this.listGroup[index].recommendInfo this.banner = { icon: this.listGroup[index].icon, url: this.listGroup[index].uniappUrl @@ -195,7 +276,13 @@ export default { uni.navigateBack() break; } - } + }, + + goStore(id) { + uni.navigateTo({ + url: "/pagesInn/inn/innHome?id=" + id + }) + }, } }; @@ -307,8 +394,22 @@ export default { margin-left: 161rpx; margin-top: 110rpx; + .red-border-title { + display: inline-flex; + align-items: center; + box-sizing: border-box; + margin: 18rpx 0; + padding: 8rpx 0 0 8rpx; + border-left: 6rpx solid #FD574B; + color: #262626; + font-size: 30rpx; + line-height: 30rpx; + font-weight: bold; + vertical-align: bottom; + } + .fixed-box { - padding: 32rpx 0 44rpx 38rpx; + padding: 32rpx 0 0 38rpx; .line-location { font-size: 28rpx; @@ -338,6 +439,77 @@ export default { } } + .recommendInfo { + position: relative; + margin-left: 38rpx; + + .scroll-box { + position: relative; + width: 520rpx; + height: 314rpx; + box-sizing: border-box; + padding: 70rpx 20rpx 0 20rpx; + border-radius: 20rpx; + background-repeat: no-repeat; + background-size: 520rpx 314rpx; + } + + .item { + position: relative; + width: 136rpx; + height: 220rpx; + margin-right: 28rpx; + border-radius: 8rpx; + background: linear-gradient(180deg, #08255D 0%, #6FA2FF 100%); + color: #FFFFFF; + line-height: 1; + //overflow: hidden; + + image { + vertical-align: middle; + } + + .cover { + width: 136rpx; + height: 136rpx; + border-radius: 8rpx; + } + + .logo { + position: absolute; + left: 68rpx; + top: 136rpx; + transform: translate(-50%, -50%); + width: 40rpx; + height: 40rpx; + border-radius: 50%; + } + + .name { + padding-bottom: 10rpx; + font-size: 24rpx; + } + + .text { + padding-bottom: 10rpx; + font-size: 16rpx; + } + } + + .item::after { + content: ''; + position: absolute; + right: -14rpx; + top: 26rpx; + width: 2rpx; + height: 172rpx; + background: #D2E0E8; + } + .item:last-child::after{ + display: none; + } + } + .province-name { margin: 0 38rpx 24rpx; font-size: 28rpx; @@ -366,5 +538,13 @@ export default { } } } + + .bg-custom { + position: absolute; + left: 0; + top: 74rpx; + width: 520rpx; + height: 314rpx; + } } diff --git a/config/index.js b/config/index.js index e94d2c5..d928392 100644 --- a/config/index.js +++ b/config/index.js @@ -1,11 +1,30 @@ // export const VUE_APP_API_URL = "https://shop.xdd618.com/api"; -export const VUE_APP_API_URL = "https://www.xdd618.com/api"; +// export const VUE_APP_API_URL = "https://www.xdd618.com/api"; // export const SERVICE_API_URL = "https://service-test.xdd618.com/api"; -export const SERVICE_API_URL = "https://service.xdd618.com/api"; +// export const SERVICE_API_URL = "https://service.xdd618.com/api"; // export const SOCKET_URL = "wss://service-test.xdd618.com/ws"; -export const SOCKET_URL = "wss://service.xdd618.com/ws"; +// export const SOCKET_URL = "wss://service.xdd618.com/ws"; +const NODE_ENV = process.env.VUE_APP_ENV || 'development' +let BASE_URL = '' +let SERVICE_URL = '' +let SERVICE_WS_URL = '' +if (NODE_ENV === 'development' || NODE_ENV === 'test') { + BASE_URL = 'https://shop.xdd618.com/api' + SERVICE_URL = 'https://service-test.xdd618.com/api' + SERVICE_WS_URL = 'wss://service-test.xdd618.com/ws' +} +if (NODE_ENV === 'prod') { + BASE_URL = 'https://www.xdd618.com/api' + SERVICE_URL = 'https://service.xdd618.com/api' + SERVICE_WS_URL = 'wss://service.xdd618.com/ws' +} + +export const VUE_APP_API_URL = BASE_URL +export const SERVICE_API_URL = SERVICE_URL +export const SOCKET_URL = SERVICE_WS_URL + export const VUE_APP_RESOURCES_URL = "https://www.xdd618.com/api/file/pic"; export const STATIC_RESOURCE_URL = "https://resource.xdd618.com/image" diff --git a/package.json b/package.json index 34e955a..70070a1 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "miniapp-color-thief": "^1.0.5", "number-precision": "^1.5.2", "regenerator-runtime": "^0.12.1", - "uview-ui": "2.0.31", + "uview-ui": "2.0.36", "vconsole": "^3.14.6", "vue": "^2.6.11", "vue-ydui": "^1.2.6", @@ -117,7 +117,30 @@ "resolutions": { "@babel/runtime": "~7.17.9" }, - "uni-app": { - "scripts": {} - } + "uni-app": { + "scripts": { + "mp-weixin-test": { + "title": "微信小程序(Test环境)", + "env": { + "UNI_PLATFORM": "mp-weixin", + "VUE_APP_ENV": "test", + "UNI_OUTPUT_DIR": "dist" + }, + "define": { + "CUSTOM-CONST": true + } + }, + "mp-weixin": { + "title": "微信小程序(生产环境)", + "env": { + "UNI_PLATFORM": "mp-weixin", + "VUE_APP_ENV": "prod", + "UNI_OUTPUT_DIR": "dist" + }, + "define": { + "CUSTOM-CONST": true + } + } + } + } } diff --git a/pages.json b/pages.json index 26f21dc..efeb1ba 100644 --- a/pages.json +++ b/pages.json @@ -254,18 +254,6 @@ "navigationBarTitleText": "用户vip" } }, - { - "path": "pages/user/coupon/UserCoupon/index", - "style": { - "navigationBarTitleText": "优惠券" - } - }, - { - "path": "pages/user/coupon/GetCoupon/index", - "style": { - "navigationBarTitleText": "领取优惠券" - } - }, { "path": "pages/user/promotion/UserCash/index", "style": { @@ -743,6 +731,12 @@ "navigationBarTitleText": "绑定手机号" } }, + { + "path": "views/myCoupons", + "style": { + "navigationBarTitleText": "我的优惠券" + } + }, { "path": "views/payPassword", "style": { @@ -920,32 +914,27 @@ ] }, "condition": { - "current": 3, + "current": 1, "list": [ { "name": "商品详情", "path": "pages/shop/GoodsCon/index", - "query": "id=303&from=famous" + "query": "id=289" + }, + { + "name": "v9-2", + "path": "pages/order/OrderSubmission/index", + "query": "id=2539" }, { "name": "DEBUG", - "path": "pkg_product/views/healthList", - "query": "id=32" - }, - { - "name": "节日", - "path": "pkg_product/views/festival", - "query": "" + "path": "pages/shop/GoodsCon/index", + "query": "id=466" }, { "name": "非遗", - "path": "pkg_product/views/heritage", - "query": "" - }, - { - "name": "地标好物", - "path": "pages/home/landMark", - "query": "" + "path": "pages/order/OrderSubmission/index", + "query": "id=2597" } ] } diff --git a/pages/cloud/haveFun.vue b/pages/cloud/haveFun.vue index 14d4543..6ce0365 100644 --- a/pages/cloud/haveFun.vue +++ b/pages/cloud/haveFun.vue @@ -28,7 +28,6 @@ export default { if (memCityName.length) { this.cityName = memCityName; uni.removeStorageSync("cityName") - console.log("memCityName if") this.search(); } }, diff --git a/pages/home/index.vue b/pages/home/index.vue index 16a35fa..39eac5d 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -66,10 +66,10 @@ - - - - + + + + @@ -244,7 +244,7 @@ - + @@ -314,7 +314,7 @@ import hxNavbar from "@/components/hx-navbar/hx-navbar.vue" import imgBox from '@/components/imageTypeSet/imagebox.vue' import LsSwiper from '@/components//ls-swiper/index.vue' -import {noticeDetail, noticeList} from "@/api/user"; +import {getCouponReceive, noticeDetail, noticeList} from "@/api/user"; import {getHomeData, getShareImage} from '@/api/public'; import {getHomeHotelList} from "@/api/inn.js"; import {getProducts} from "@/api/store"; @@ -457,6 +457,7 @@ export default { }, onLoad: function (options) { that = this; + this.init(); getShareImage().then(({data}) => this.shareAppImg = data); uni.getSystemInfo({ success: (e) => { @@ -522,7 +523,6 @@ export default { this.getUnreadMsgList(); } - this.init(); //获取团购商品 this.getGroupGoods(); }, @@ -668,6 +668,7 @@ export default { msgConfirm: function () { that.$refs.popup.close(); }, + getHotelList: function () { let that = this; @@ -829,6 +830,36 @@ export default { goFestival() { uni.navigateTo({url: '/pkg_product/views/festival'}) + }, + tapOld() { + this.isOldUser =false + const {type, text, jumpTime, pageLevel, url, params, couponId} = this.oldUserPopup + if (couponId != null) { + getCouponReceive(couponId).then(res => { + if (res.status === 200) { + uni.showToast({ + title: text, + icon: 'none', + success: () => { + } + }) + } + }).catch((err) => { + uni.showToast({ + title: err.data.msg+'', + icon: 'none', + duration:3000 + }) + }) + } + // type 1-定时跳转,2-点击跳转,3-不跳转 + if (type === 1) { + setTimeout(() => { + this.$global.levelJump(pageLevel, url, params) + }, jumpTime * 1000) + } else if (type === 2) { + this.$global.levelJump(pageLevel, url, params) + } } } }; @@ -1735,8 +1766,8 @@ export default { .swiper { position: absolute; - left:20rpx; - bottom:20rpx; + left: 20rpx; + bottom: 20rpx; width: 296rpx; height: 72rpx; overflow: hidden; diff --git a/pages/home/landMark.vue b/pages/home/landMark.vue index 66cbe88..7be8329 100644 --- a/pages/home/landMark.vue +++ b/pages/home/landMark.vue @@ -27,7 +27,7 @@ export default { return 718 / (this.mapData?.mapImageWidth || 1); } }, - onShow() { + onLoad() { this.getNavList(); }, onReachBottom() { @@ -91,6 +91,7 @@ export default { + diff --git a/pages/order/OrderDetails/index.vue b/pages/order/OrderDetails/index.vue index 92a1101..e0b1b89 100644 --- a/pages/order/OrderDetails/index.vue +++ b/pages/order/OrderDetails/index.vue @@ -193,7 +193,7 @@ ¥{{ force2Decimal(orderInfo.totalPrice) }} - 优惠券抵扣: + 优惠券抵扣: -¥{{ force2Decimal(orderInfo.couponPrice) }} diff --git a/pages/order/OrderSubmission/index.vue b/pages/order/OrderSubmission/index.vue index 4377708..6c5ebf0 100644 --- a/pages/order/OrderSubmission/index.vue +++ b/pages/order/OrderSubmission/index.vue @@ -1,31 +1,6 @@ - diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index b7f6ba9..bbcaf73 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -198,39 +198,27 @@ {{ tempName }} 销量:{{ dayInfo.sales }}{{ dayInfo.unitName }} - - - - - - - - - - - - - - + + + + + + + + + {{ item.couponTitle }} + + + 优惠详情 + + + + 规格 @@ -459,7 +447,7 @@ - + @@ -488,13 +476,12 @@ diff --git a/pages/shop/ShoppingCart/index.vue b/pages/shop/ShoppingCart/index.vue index b22817e..046c731 100644 --- a/pages/shop/ShoppingCart/index.vue +++ b/pages/shop/ShoppingCart/index.vue @@ -1,16 +1,5 @@ + + + + \ No newline at end of file diff --git a/uni_modules/uview-ui/LICENSE b/uni_modules/uview-ui/LICENSE index 8e39ead..4db40ef 100644 --- a/uni_modules/uview-ui/LICENSE +++ b/uni_modules/uview-ui/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 www.uviewui.com +Copyright (c) 2023 www.uviewui.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/uni_modules/uview-ui/changelog.md b/uni_modules/uview-ui/changelog.md index ca50251..f2bae72 100644 --- a/uni_modules/uview-ui/changelog.md +++ b/uni_modules/uview-ui/changelog.md @@ -1,4 +1,9 @@ -## 2.0.34(2022-09-25) +## 2.0.36(2023-03-27) +# uView2.0重磅发布,利剑出鞘,一统江湖 + +1. 重构`deepClone` & `deepMerge`方法 +2. 其他优化 +## 2.0.34(2022-09-24) # uView2.0重磅发布,利剑出鞘,一统江湖 1. `u-input`、`u-textarea`增加`ignoreCompositionEvent`属性 diff --git a/uni_modules/uview-ui/components/u-button/u-button.vue b/uni_modules/uview-ui/components/u-button/u-button.vue index e46ca7f..5494351 100644 --- a/uni_modules/uview-ui/components/u-button/u-button.vue +++ b/uni_modules/uview-ui/components/u-button/u-button.vue @@ -211,7 +211,7 @@ export default { let style = {}; if (this.color) { // 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色 - style.color = this.plain ? this.color : "#EEEEEE"; + style.color = this.plain ? this.color : "white"; if (!this.plain) { // 非镂空,背景色使用自定义的颜色 style["background-color"] = this.color; diff --git a/uni_modules/uview-ui/components/u-calendar/header.vue b/uni_modules/uview-ui/components/u-calendar/header.vue index 1bdb389..dc4f7d0 100644 --- a/uni_modules/uview-ui/components/u-calendar/header.vue +++ b/uni_modules/uview-ui/components/u-calendar/header.vue @@ -8,7 +8,7 @@ class="u-calendar-header__subtitle" v-if="showSubtitle" >{{ subtitle }} - + diff --git a/uni_modules/uview-ui/components/u-calendar/month.vue b/uni_modules/uview-ui/components/u-calendar/month.vue index f61d484..c20937f 100644 --- a/uni_modules/uview-ui/components/u-calendar/month.vue +++ b/uni_modules/uview-ui/components/u-calendar/month.vue @@ -10,37 +10,15 @@ - - + - - {{ item1.day }} - - - - - - - {{ getBottomInfo(index, index1, item1).text }} - - - + :style="[textStyle(item1)]">{{ getBottomInfo(index, index1, item1) }} + @@ -203,11 +181,10 @@ if (this.mode === 'single') { if (date === this.selected[0]) { // 因为需要对nvue的兼容,只能这么写,无法缩写,也无法通过类名控制等等 - style.borderRadius = '50%' - // style.borderTopLeftRadius = '3px' - // style.borderBottomLeftRadius = '3px' - // style.borderTopRightRadius = '3px' - // style.borderBottomRightRadius = '3px' + style.borderTopLeftRadius = '3px' + style.borderBottomLeftRadius = '3px' + style.borderTopRightRadius = '3px' + style.borderBottomRightRadius = '3px' } } else if (this.mode === 'range') { if (this.selected.length >= 2) { @@ -373,7 +350,6 @@ }, // 点击某一个日期 clickHandler(index1, index2, item) { - this.$emit('select', item) if (this.readonly) { return; } @@ -478,25 +454,7 @@