diff --git a/aiChat/mixins/chatMixins.js b/aiChat/mixins/chatMixins.js index 5b59f6b..601d99a 100644 --- a/aiChat/mixins/chatMixins.js +++ b/aiChat/mixins/chatMixins.js @@ -372,7 +372,7 @@ export const chatMixins = { const _this = this console.log('------------------创建连接') uni.connectSocket({ - url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${conversationId}`, + url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.uid}-${conversationId}`, header: { 'content-type': 'application/json' }, diff --git a/aiChat/mixins/chatMixinsV2.js b/aiChat/mixins/chatMixinsV2.js index a854680..10ac0c8 100644 --- a/aiChat/mixins/chatMixinsV2.js +++ b/aiChat/mixins/chatMixinsV2.js @@ -334,7 +334,7 @@ export const chatMixinsV2 = { const _this = this console.log('------------------创建连接') uni.connectSocket({ - url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${conversationId}`, + url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.uid}-${conversationId}`, header: { 'content-type': 'application/json' }, diff --git a/aiChat/views/index.vue b/aiChat/views/index.vue index e43ff28..86ae0e8 100644 --- a/aiChat/views/index.vue +++ b/aiChat/views/index.vue @@ -184,7 +184,12 @@ 价格预算: - + @@ -857,10 +862,18 @@ export default { display: flex; flex-direction: column; justify-content: space-between; - height: calc(100vh - 240rpx); + min-height: calc(100vh - 240rpx); + height: auto; padding: 0 0 240rpx 0; + padding-bottom: calc(240rpx + constant(safe-area-inset-bottom)); + padding-bottom: calc(240rpx + env(safe-area-inset-bottom)); box-sizing: border-box; - overflow-y: auto; + overflow: visible; +} +.gift-steps-wrap { + padding-bottom: 40rpx; + padding-bottom: calc(40rpx + constant(safe-area-inset-bottom)); + padding-bottom: calc(40rpx + env(safe-area-inset-bottom)); } .focus-guide-wrap { display: flex; diff --git a/api/join.js b/api/join.js index 1543180..9b6cff0 100644 --- a/api/join.js +++ b/api/join.js @@ -17,8 +17,8 @@ export function getShopData(params) { // 查看商户申请 // 1-特产供应商 2-店铺 3-文玩供应商 -export function getShopInfo() { - return request.get("/merchantApply/info", {}, {login: true}) +export function getShopInfo(params) { + return request.get("/merchantApply/info", params, {login: true}) } // 4-采购批发商 @@ -38,6 +38,18 @@ export function saveShop(hotelInfo, partnerId = '', promoterUid = '') { return request.post("/merchantApply/hotel/submit", param, {login: true}) } +// 保存店铺入驻草稿 +export function saveHotelDraft(hotelInfo, partnerId = '', promoterUid = '') { + let param = {hotelInfo, captcha: hotelInfo.captcha}; + if (partnerId && partnerId.length > 0) { + param.partnerId = partnerId; + } + if (promoterUid && promoterUid.length > 0) { + param.promoterUid = promoterUid; + } + return request.post("/merchantApply/hotel/saveDraft", param, {login: true}) +} + // 提交特产供应商入驻申请 export function saveSupplier(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') { let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha}; @@ -62,12 +74,30 @@ export function saveWenwanSupplier(hotelInfo, supplierInfo, partnerId = '', prom return request.post("/merchantApply/wenwanSupplier/submit", param, {login: true}) } +// 保存供应商入驻草稿(特产/文玩共用) +export function saveSupplierDraft(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') { + let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha}; + if (partnerId && partnerId.length > 0) { + param.partnerId = partnerId; + } + if (promoterUid && promoterUid.length > 0) { + param.promoterUid = promoterUid; + } + return request.post("/merchantApply/supplier/saveDraft", param, {login: true}) +} + // 提交采购批发商入驻申请 export function saveWholesaler(wholesalerInfo) { let param = {wholesalerInfo, captcha: wholesalerInfo.captcha}; return request.post("/merchantApply/wholesaler/submit", param, {login: true}) } +// 保存采购批发商入驻草稿 +export function saveWholesalerDraft(wholesalerInfo) { + let param = {wholesalerInfo, captcha: wholesalerInfo.captcha}; + return request.post("/merchantApply/wholesaler/saveDraft", param, {login: true}) +} + export function saveExperienceStore(params) { return request.post("/merchantApply/experienceStore/submit", params, {login: true}) } diff --git a/assets/css/aiChat.less b/assets/css/aiChat.less index b7846fb..6311185 100644 --- a/assets/css/aiChat.less +++ b/assets/css/aiChat.less @@ -8,18 +8,22 @@ page { justify-content: space-between; } .fix-tabbar-page { - position: relative; - min-height: 100vh; - background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%); - // background-color: #fff; - // background-size: 100% calc(100vh - 160rpx); - // background-image: url(https://wxapp.xdd618.com/api/file/pic/aiChat/bg.png); - // background-repeat: no-repeat; - // background-attachment: fixed; - &.new-chat { - background-size: 100% calc(100vh - 160rpx); - background-repeat: no-repeat; - } + position: relative; + z-index: 0; + min-height: 100vh; + background: transparent; + isolation: isolate; + &::before { + content: ''; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: -1; + pointer-events: none; + background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%); + } .fix-tabbar-header { position: fixed; top: 0; diff --git a/assets/css/pkg_join.less b/assets/css/pkg_join.less index 9c468fc..3ab1dcc 100644 --- a/assets/css/pkg_join.less +++ b/assets/css/pkg_join.less @@ -127,6 +127,25 @@ height: 52vh; overflow-y: auto; margin: 30rpx 0; + + // 小程序rich-text内块级标签无默认段间距,补充与后台富文本编辑器一致的段落格式 + rich-text { + display: block; + width: 100%; + + p, div, ul, ol { + display: block; + margin: 0 0 16rpx; + + &:last-child { + margin-bottom: 0; + } + } + + li { + margin: 0 0 8rpx; + } + } } .agree-box { diff --git a/assets/script/global.js b/assets/script/global.js index 5f4d9f5..347311f 100644 --- a/assets/script/global.js +++ b/assets/script/global.js @@ -42,9 +42,20 @@ export default { }, goSupplierMini() { + // 区分当前小程序环境:正式版跳正式版,体验版/开发版跳体验版 + let envVersion = 'release' + try { + const accountInfo = uni.getAccountInfoSync() + if (accountInfo && accountInfo.miniProgram && accountInfo.miniProgram.envVersion !== 'release') { + envVersion = 'trial' + } + } catch (e) { + envVersion = 'release' + } uni.navigateToMiniProgram({ appId: "wx9ca93d1f2a9c8156", path: "pages/auth/login", + envVersion, success(msg) { console.log("success", msg) }, diff --git a/config/index.js b/config/index.js index f386c48..c6467b1 100644 --- a/config/index.js +++ b/config/index.js @@ -10,6 +10,14 @@ if (NODE_ENV === 'development' || NODE_ENV === 'test') { enableDebug: false }) } +if (NODE_ENV === 'fix') { + BASE_URL = 'https://shop-pre.xdd618.com/api' + SERVICE_URL = 'https://service-pre.xdd618.com/api' + SERVICE_WS_URL = 'wss://service-pre.xdd618.com/ws' + wx.setEnableDebug({ + enableDebug: false + }) +} if (NODE_ENV === 'prod') { BASE_URL = 'https://wxapp.xdd618.com/api' SERVICE_URL = 'https://service.xdd618.com/api' diff --git a/package.json b/package.json index 858a590..d8db073 100644 --- a/package.json +++ b/package.json @@ -133,6 +133,17 @@ "CUSTOM-CONST": true } }, + "mp-weixin-fix": { + "title": "微信小程序(Fix环境)", + "env": { + "UNI_PLATFORM": "mp-weixin", + "VUE_APP_ENV": "fix", + "UNI_OUTPUT_DIR": "dist" + }, + "define": { + "CUSTOM-CONST": true + } + }, "mp-weixin": { "title": "微信小程序(生产环境)", "env": { diff --git a/pages.json b/pages.json index 92728cc..04d8535 100644 --- a/pages.json +++ b/pages.json @@ -355,7 +355,7 @@ { "path": "views/wholesaler", "style": { - "navigationBarTitleText": "采购批发商入驻" + "navigationBarTitleText": "礼品集采中心入驻" } }, { diff --git a/pages/Loading/index.vue b/pages/Loading/index.vue index 33a3b90..5148562 100644 --- a/pages/Loading/index.vue +++ b/pages/Loading/index.vue @@ -49,21 +49,18 @@ export default { // 注释下面一行,会停留在启动页 setTimeout(() => { this.toLaunch(); - }, 2000) + }, 5000) return; } + // 未登录:静默处理登录,5秒后跳转业务页面 cookie.get("spread"); - // this.toLaunch(); - if (this.$deviceType == "app") { - // this.toLaunch(); - this.$yrouter.switchTab({ - path: "/pages/home/index" - }); - return; + if (this.$deviceType != "app") { + //检查授权信息 + this.checkUserInfo(); } - - //检查授权信息 - this.checkUserInfo(); + setTimeout(() => { + this.toLaunch(); + }, 5000); }, methods: { ...mapActions(["changeAuthorization", "setUserInfo"]), @@ -89,11 +86,7 @@ export default { } } - login(loginInfo).finally(() => { - this.$yrouter.switchTab({ - path: "/pages/home/index" - }); - }); + login(loginInfo); } diff --git a/pages/VideoPlayBackList/VideoPlayBackList.vue b/pages/VideoPlayBackList/VideoPlayBackList.vue index b2fd8c7..e74a49a 100644 --- a/pages/VideoPlayBackList/VideoPlayBackList.vue +++ b/pages/VideoPlayBackList/VideoPlayBackList.vue @@ -6,27 +6,42 @@ - + - - - + + + - {{ item.title }} + {{ lItem.title }} - - {{ item.storeName }} + + {{ lItem.storeName }} - + + + + + + {{ rItem.title }} + + + + {{ rItem.storeName }} + + + + + + - + 暂无数据 @@ -38,6 +53,11 @@ import {getStoreVideoType, getArticleList} from '@/api/public' import {getVideoList} from '@/api/user' import { pageListenMixins } from '@/mixins/pageListenMixins' +// 封面固定宽度(rpx) +const COVER_WIDTH = 332 +// 每项除封面外的文字内容预估高度(rpx) +const TEXT_HEIGHT = 120 + export default { mixins: [pageListenMixins], data() { @@ -48,11 +68,19 @@ export default { page: 1, limit: 10, keyword: '', - list: [], + leftList: [], + rightList: [], + leftHeight: 0, + rightHeight: 0, isWait: false, pageKeyId: Object.freeze('findVideoList') } }, + computed: { + hasList() { + return this.leftList.length + this.rightList.length > 0 + } + }, onLoad(options) { if (!options.click) { uni.switchTab({ url: '/pages/home/index' }) @@ -78,10 +106,16 @@ export default { changeType(item) { this.type = item.value this.page = 1 - this.list = [] + this.resetList() this.fetchList() }, - fetchList() { + resetList() { + this.leftList = [] + this.rightList = [] + this.leftHeight = 0 + this.rightHeight = 0 + }, + async fetchList() { if (this.isWait) return this.isWait = true const params = { @@ -89,16 +123,47 @@ export default { page: this.page, limit: this.limit } - getVideoList(params).then(res => { + try { + const res = await getVideoList(params) if (res.status === 200) { - for (let i = 0; i < res.data.length; i++) { - res.data[i].hide = true - this.list.push(res.data[i]) + const items = res.data + for (let i = 0; i < items.length; i++) { + items[i].hide = true } + // 并行获取所有封面高度 + const heights = await Promise.all(items.map(item => this.getImageHeight(item.cover))) + items.forEach((item, i) => { + this.pushToColumn(item, heights[i] + TEXT_HEIGHT) + }) } + } catch (e) { + // 忽略请求或图片尺寸获取失败 + } finally { this.isWait = false + } + }, + getImageHeight(src) { + return new Promise(resolve => { + uni.getImageInfo({ + src, + success: res => { + resolve(res.height / res.width * COVER_WIDTH) + }, + fail: () => { + resolve(COVER_WIDTH) + } + }) }) }, + pushToColumn(item, height) { + if (this.leftHeight <= this.rightHeight) { + this.leftList.push(item) + this.leftHeight += height + } else { + this.rightList.push(item) + this.rightHeight += height + } + }, goDetail(item) { this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id + '&click=1') } @@ -129,25 +194,22 @@ export default { margin: 28rpx 32rpx; .video-waterfalls-wrap { - direction: ltr; + display: flex; + justify-content: space-between; + align-items: flex-start; + } - /deep/ .waterfalls-flow { - direction: ltr; - text-align: left; - } - - /deep/ .waterfalls-flow-column { - float: left !important; - } + .waterfalls-column { + width: 332rpx; } .item { + margin-bottom: 20rpx; border-radius: 4rpx; background: #fff; .cover { width: 332rpx; - //height: 200rpx; vertical-align: middle; } diff --git a/pages/home/index.vue b/pages/home/index.vue index 858c2ea..47a992e 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -916,6 +916,18 @@ export default { } app.globalData.homeDrawPosterShownInSession = true }, + hasShownOldUserPopupInSession() { + const app = getApp && getApp() + return Boolean(app && app.globalData && app.globalData.homeOldUserPopupShownInSession) + }, + markOldUserPopupShownInSession() { + const app = getApp && getApp() + if (!app) return + if (!app.globalData) { + app.globalData = {} + } + app.globalData.homeOldUserPopupShownInSession = true + }, initPosterPopupState(data = {}) { const drawEntranceConfig = data.drawEntranceConfig || {} this.$set(this, 'drawEntranceConfig', drawEntranceConfig) @@ -932,10 +944,19 @@ export default { (data.lotteryCanDraw || false) ) this.isDrawPosterVisible = shouldShowDrawPoster - this.isOldUser = !shouldShowDrawPoster && !hasShownDrawPosterInSession && this.canShowOldPoster + const shouldShowOldUserPopup = + !shouldShowDrawPoster && + !hasShownDrawPosterInSession && + this.canShowOldPoster && + !this.hasShownOldUserPopupInSession() + if (shouldShowOldUserPopup) { + this.markOldUserPopupShownInSession() + } + this.isOldUser = shouldShowOldUserPopup }, showNextPoster() { - if (!this.isDrawPosterVisible && this.canShowOldPoster) { + if (!this.isDrawPosterVisible && this.canShowOldPoster && !this.hasShownOldUserPopupInSession()) { + this.markOldUserPopupShownInSession() this.isOldUser = true } }, diff --git a/pages/order/MyOrder/index.vue b/pages/order/MyOrder/index.vue index 79a070d..3eac9b2 100644 --- a/pages/order/MyOrder/index.vue +++ b/pages/order/MyOrder/index.vue @@ -12,7 +12,7 @@ v-model="keyword" :inputStyle="inputStyle" :showAction="false" - placeholder="请输入商品名/订单号/团购名称" + :placeholder="searchPlaceholder" shape="round" bgColor="#FFF" @search="changeType" @@ -76,28 +76,28 @@ - {{ order.merName }} + {{ getOrderStoreName(order) }} - + - {{ order.merCityName }} + {{ getOrderCityName(order) }} @@ -131,7 +131,7 @@ {{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : (getStatus(order) || (order._status && order._status._title) || '已完成') }} + >{{ getOrderStatusTagText(order) }} + + + + + + + + {{ item.name }} + + + + {{ force2Decimal(item.price) }} + + + + + + {{ item.sku }} + + x{{ item.qty }} + + + 礼品价值: + ¥{{ force2Decimal(item.giftValue) }} + + + + @@ -244,7 +282,7 @@ - + {{ order.createTime }} - 共{{ order.totalNum || 0 }}件商品 - + 共{{ getOrderTotalNum(order) }}件商品 + ,总金额 @@ -309,7 +347,7 @@ ¥ - {{ force2Decimal(order.payPrice) }} + {{ force2Decimal(getOrderPayPrice(order)) }} @@ -351,63 +389,101 @@ v-if="!order.isGiftCardSend && !order.experienceOrderInfo" class="bottom flex jc-between ai-center" > - - - 更多 - - 联系商家 - 申请退款 - - -