diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..684d827 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.associations": { + "*.ttml": "xml", + "*.ttss": "css" + } +} \ No newline at end of file diff --git a/App.vue b/App.vue index 48bbd2d..79a1e7a 100644 --- a/App.vue +++ b/App.vue @@ -6,8 +6,9 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有 { + let that = this uni.hideTabBar() // #ifdef MP-WEIXIN const updateManager = wx.getUpdateManager() // 小程序版本更新管理器 @@ -23,6 +24,146 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有 { + //请求后台接口 解析数据 对比版本 + console.log("widgetInfo==",widgetInfo) + getFindBySource({source:'APP'}).then(res => { + console.log("selectNewApp==",res) + console.log("version===",res.url && widgetInfo.version < res.version) + if (res.url && widgetInfo.version < res.version) { + console.log("version===222") + let downloadLink = res.url; + // let downloadLink = "https://short-video.hnsiyao.cn/app/sy-duanju.apk"; + console.log(downloadLink) + // let androidLink = res.androidWgtUrl; + // let iosLink = res.iosWgtUrl; + let ready = false; + // 校验是否强制升级 + if (res.isUp == 1) { + uni.showModal({ + showCancel: false, + title: '发现新版本', + confirmText: '立即更新', + content: res.message, + success: res => { + if (res.confirm) { + uni.showLoading('下载中...'); + if (uni.getSystemInfoSync().platform == + 'android') { + uni.downloadFile({ + url: downloadLink, + success: downloadResult => { + if (downloadResult.statusCode === 200) { + plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => { + entry.getParent(_oldFile=>{ + entry.moveTo(_oldFile,'.apk',newFilePath=>{ + console.log('newFilePath',newFilePath.fullPath) + plus.runtime + .install(newFilePath.fullPath, { force: false }, + d => { + console + .log( + 'install success...' + ); + plus.runtime + .restart(); + }, + e => { + console.log(e) + console + .error( + 'install fail...' + ); + } + ); + }) + }) + }) + } + } + }); + } + if (uni.getSystemInfoSync().platform == + 'ios') { + plus.runtime.openURL(downloadLink, function( + res) {}); + } + } else if (res.cancel) { + console.log('取消'); + } + } + }); + } else { + uni.showModal({ + title: '发现新版本', + confirmText: '立即更新', + cancelText: '下次更新', + content: res.message, + success: res => { + if (res.confirm) { + uni.showLoading('下载中...'); + if (uni.getSystemInfoSync().platform == + 'android') { + uni.downloadFile({ + url: downloadLink, + success: downloadResult => { + if (downloadResult + .statusCode === + 200) { + plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => { + entry.getParent(_oldFile=>{ + entry.moveTo(_oldFile,'.apk',newFilePath=>{ + console.log('newFilePath',newFilePath.fullPath) + plus.runtime + .install(newFilePath.fullPath, { force: false }, + d => { + console + .log( + 'install success...' + ); + plus.runtime + .restart(); + }, + e => { + console.log(e) + console + .error( + 'install fail...' + ); + } + ); + }) + }) + }) + + } + } + }); + } + if (uni.getSystemInfoSync().platform == + 'ios') { + plus.runtime.openURL(downloadLink, function( + res) {}); + } + } else if (res.cancel) { + console.log('取消'); + } + } + }); + } + } + }).catch((res)=>{ + console.log(res) + }) + }); + + // #endif + }); diff --git a/http/php/api.ts b/http/php/api.ts new file mode 100644 index 0000000..b42ecd9 --- /dev/null +++ b/http/php/api.ts @@ -0,0 +1,33 @@ +import { request } from './request' +// 会员签入 登录 +export const douyincheckIn = (data : object | any) => { + return request('douyin/checkIn', 'POST', data, true) +} +// 登出 +export const userlogout = () => { + return request('user/logout', 'POST', '', true) +} +// 查询绑定状态 +export const searchstorestatus = (data : object) => { + return request('meituan/searchstorestatus', 'POST', data, true) +} +// 团购核销准备 +export const fulfilmentcertificateprepare = (data : object) => { + return request('douyin/fulfilmentcertificateprepare', 'POST', data, true) +} +// 获取uisdk 绑定 链接 +export const getuisdk = (data : object) => { + return request('douyin/getuisdk', 'POST', data, true) +} +// 团购核销 +export const certificateprepares = (data : object) => { + return request('douyin/certificateprepare', 'POST', data, true) +} +// 团购核销记录 +export const orderlist = (data : object) => { + return request('douyin/orderlist', 'POST', data, true) +} +// 团购核销撤销 +export const fulfilmentcertificatecanceles = (data : object) => { + return request('douyin/fulfilmentcertificatecancel', 'POST', data, true) +} diff --git a/http/php/request.ts b/http/php/request.ts new file mode 100644 index 0000000..f0ae0a2 --- /dev/null +++ b/http/php/request.ts @@ -0,0 +1,80 @@ +//服务器接口地址 +const baseURL : string = 'https://czgdoumei.sxczgkj.com/index.php/api/' +// 封装公共请求方法 +function request(url : string, method : "GET" | "POST" | undefined, data : object | any, toast : boolean) { + let networkType = '' + uni.getNetworkType({ + success: (res) => { + networkType = res.networkType + } + }); + if (networkType == 'none') { + uni.showToast({ + title: '网络异常,请检查网络', + icon: 'none' + }) + return false; + } + if (toast) { + uni.showLoading({ + title: '加载中', + mask: true + }) + } + return new Promise(async (resolve, reject) => { + let header : any + header = { + 'content-type': 'application/json', + 'clinttype':uni.getStorageSync('clint_type'), + 'bausertoken': uni.getStorageSync('phpuserinfo').token + }; + uni.request({ + url: baseURL + url, + method: method, + data: data, + header: header, + success(res : any) { + if (res.data.code != 1) { + //是否提示错误 + if (toast) { + uni.showToast({ + title: res.data.msg || res.data.message, + icon: 'none' + }) + setTimeout(() => { + uni.hideLoading() + }, 1000) + } + if (res.data.code == 401) { + uni.showToast({ + title: res.message || res.msg, + icon: "none", + success: () => { + // uni.removeStorageSync('logintoken'); + // uni.removeStorageSync('token'); + uni.reLaunch({ + url: '/pages/index/index' + }) + } + }) + } + uni.hideLoading() + reject(res.message | res.msg); + } else { + uni.hideLoading() + resolve(res.data.data); + } + }, + fail(err) { + uni.hideLoading() + //请求失败 + uni.showToast({ + title: '无法连接到服务器', + icon: 'none' + }) + reject(err) + } + }) + }) +} +export { request, baseURL } \ No newline at end of file diff --git a/http/yskApi/http.js b/http/yskApi/http.js index 67aef22..bf3c162 100644 --- a/http/yskApi/http.js +++ b/http/yskApi/http.js @@ -202,6 +202,7 @@ function request(args) { method: method, header: getHeader() }, extParams) + ) }) } diff --git a/http/yskApi/version.js b/http/yskApi/version.js new file mode 100644 index 0000000..9929361 --- /dev/null +++ b/http/yskApi/version.js @@ -0,0 +1,15 @@ +import http from './http.js' +const request=http.request + + +/** + * 查询所属渠道升级版本 + * @returns + */ +export function getFindBySource(params) { + return request({ + url: `/api/tbVersion/findBySource`, + method: 'get', + params + }) +} diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue index 636d879..dbc6850 100644 --- a/pageProduct/add-Product/add-Product.vue +++ b/pageProduct/add-Product/add-Product.vue @@ -12,14 +12,15 @@ - + - + - + - + @@ -90,7 +91,7 @@ --> - + @@ -515,12 +516,12 @@ * - 重量 + 单位 用于快递或配送运费计重 @@ -540,11 +541,10 @@ --> - + - + + * 定时上下架 {{returnTimerDayText()}} - {{returnTimerTimeText()}} + {{returnTimerTimeText()}} + @@ -701,8 +703,8 @@ - - + + @@ -896,13 +898,13 @@ let proGroupVoGoodsIndex = undefined function refChooseGuigeOpen(skuList, groupIndex, goodsIndex) { + console.log(groupIndex, goodsIndex) proGroupVoIndex = groupIndex proGroupVoGoodsIndex = goodsIndex refChooseGuige.value.open(skuList) } function refChooseGuigeConfirm(sku) { - console.log(sku); FormData.proGroupVo[proGroupVoIndex].goods[proGroupVoGoodsIndex].skuName = sku.specSnap || sku.name FormData.proGroupVo[proGroupVoIndex].goods[proGroupVoGoodsIndex].skuId = sku.id proGroupVoIndex = undefined @@ -916,7 +918,7 @@ function proGroupVoAddGoods(index, arr) { proGroupVoIndex = index - if(!FormData.proGroupVo){ + if (!FormData.proGroupVo) { initDefaultProGroupVo() } if (FormData.groupType == 0) { @@ -945,7 +947,6 @@ } function refChooseGoodsConfirm(arr) { - console.log(arr); refChooseGoodsClose() arr = arr.map(v => { const { @@ -974,10 +975,8 @@ skuName: '' } }) - console.log(arr); - console.log(FormData.groupType); + if (FormData.groupType == 0) { - console.log(FormData.proGroupVo[0]); return FormData.proGroupVo[0].goods = arr } if (FormData.groupType == 1 && proGroupVoIndex !== undefined) { @@ -1230,13 +1229,13 @@ //表单边框 const inputBorder = ref(false) const FormData = reactive({ - days: '', - startTime: '', - endTime: '', + days: "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", + endTime: "23:59", + startTime: "00:00", //每日销量上限, dayLimit: 0, - singleOrderLimit:0, - singlePeopleLimit:0, + singleOrderLimit: 0, + singlePeopleLimit: 0, type: 'normal', showType: ['table'], specsInfoName: '', @@ -1364,7 +1363,7 @@ res.specsInfoName = specsInfoName $goodsData = res skuList.list = res.skuList - res.showType=res.showType.split(',') + res.showType = res.showType.split(',') Object.assign(FormData, res) //多规格 if (res.typeEnum === 'sku') { @@ -1572,6 +1571,12 @@ getTbShopUnit() getTbProductSpec() }) + const changeFormDatatype = (e) => { + console.log(e) + console.log(FormData) + // 当是称重商品时 默认是单规格 + FormData.typeEnum = 'normal' + } onShow(() => { // if (option.type === 'edit') { @@ -1685,7 +1690,7 @@ } } if (type == 'package') { - if (groupType == 0&& FormData.proGroupVo[0].goods.length<=0) { + if (groupType == 0 && FormData.proGroupVo[0].goods.length <= 0) { // 固定套餐 return infoBox.showToast('套餐组合至少需要包含一种商品,请添加商品') } @@ -1693,6 +1698,7 @@ let ispase = FormData.proGroupVo.length > 0 ? true : false let tips = ispase ? '' : '请添加至少一种套餐' for (let i in FormData.proGroupVo) { + FormData.proGroupVo[i].count = FormData.proGroupVo[i].goods.length const item = FormData.proGroupVo[i] if (item.goods.length <= 0) { ispase = false @@ -1718,7 +1724,7 @@ } const submitData = { ...FormData, - showType:FormData.showType.join(','), + showType: FormData.showType.join(','), proGroupVo: type != 'package' ? '' : FormData.proGroupVo, images: images, coverImg: images[0] || '', @@ -1744,6 +1750,19 @@ }) }) } + // 如果套餐没选择规格,默认选中第一条 + console.log(submitData.proGroupVo) + if (submitData.proGroupVo) { + submitData.proGroupVo.forEach((res, index) => { + submitData.proGroupVo[index].goods.forEach(ele => { + if (!ele.skuId) { + ele.skuId = ele.skuList[0].id + ele.skuName = ele.skuList[0].specSnap || ele.skuList[0].name + } + }) + }) + } + submitData.selectSpec = $addProduct(submitData).then(res => { infoBox.showSuccessToast('添加成功') @@ -1767,7 +1786,6 @@ return result.replace(/.$/, "") } }) - /** * 监听规格保存,拿到数据 */ @@ -1931,14 +1949,14 @@ watch(() => FormData.type, (newval) => { if (option.type == 'edit') { if (newval == $goodsData.type) { - if($goodsData.proGroupVo){ - FormData.proGroupVo = $goodsData.proGroupVo||[] - }else{ + if ($goodsData.proGroupVo) { + FormData.proGroupVo = $goodsData.proGroupVo || [] + } else { initDefaultProGroupVo() } } - if(FormData.groupType==null){ - FormData.groupType=0 + if (FormData.groupType == null) { + FormData.groupType = 0 } } else { if (newval == 'package') { @@ -2005,11 +2023,22 @@ disabledChangeCategory.value = !res } } + + const activeinHouseList = computed(() => { + try { + return pageData.units.filter((item) => { + if (item.id == FormData.unitId) { + return item.name + } + })[0].name + } catch (error) { + //TODO handle the exception + } + }); /** * 权限end */ - watch(() => pageData.types, (newval) => { Forms.value.setRules(rules) }) @@ -2020,6 +2049,7 @@ onReady(() => { Forms.value && Forms.value.setRules(rules) }) + onBeforeUnmount(() => { clearTimeout(timer) }) @@ -2133,7 +2163,8 @@ flex-wrap: nowrap; justify-content: space-between; } - ::v-deep .typeEnum .u-checkbox-group--row{ + + ::v-deep .typeEnum .u-checkbox-group--row { flex-wrap: nowrap; justify-content: space-between; } diff --git a/pageProduct/add-Product/timer.vue b/pageProduct/add-Product/timer.vue index dd7a8bf..0556a3b 100644 --- a/pageProduct/add-Product/timer.vue +++ b/pageProduct/add-Product/timer.vue @@ -91,7 +91,8 @@ const hour = times.value[0][indexArr[0]] const month = times.value[1][indexArr[1]] const s = times.value[2][indexArr[2]] - return `${hour}:${month}:${s}` + // return `${hour}:${month}:${s}` + return `${hour}:${month}` } //获取$event.detail.value function getEnentDetailValue(e) { @@ -152,11 +153,11 @@ function returnBasicTimeConstructor() { return { startTime: { - value: '00:00:00', + value: '00:00', index: [0, 0, 0] }, endTime: { - value: '00:00:00', + value: '23:59', index: [0, 0, 0] } } @@ -190,13 +191,13 @@ } // 触发定时器保存事件将数据给到添加商品页面 function emitTimerSave() { - const par={ - days:list.value[0].cycleChecked.join(','), - startTime:list.value[0].startTime.value, - endTime:list.value[0].endTime.value + const par = { + days: list.value[0].cycleChecked.join(','), + startTime: list.value[0].startTime.value, + endTime: list.value[0].endTime.value } console.log(par); - uni.$emit('timerSave',par) + uni.$emit('timerSave', par) go.back() } @@ -207,14 +208,14 @@ function returnTimeIndex(time) { console.log(time); - return time.split(':').map(v=>{ - return v*1 + return time.split(':').map(v => { + return v * 1 }) } function returnTimer(res) { return [{ - cycleChecked: res.days ? res.days.split(',').filter(v=>v) : [], + cycleChecked: res.days ? res.days.split(',').filter(v => v) : [], startTime: res.startTime ? { value: res.startTime, index: returnTimeIndex(res.startTime) diff --git a/pages.json b/pages.json index 78e4a89..27aed3f 100644 --- a/pages.json +++ b/pages.json @@ -8,8 +8,7 @@ "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" } }, - "pages": [ - { + "pages": [{ "pageId": "PAGES_INDEX", "path": "pages/index/index", "style": { @@ -760,13 +759,28 @@ { "root": "pageBwc", "pages": [{ - "pageId": "PAGES_BWC", - "path": "index/index", - "style": { - "navigationBarTitleText": "霸王餐" - } + "pageId": "PAGES_BWC", + "path": "index/index", + "style": { + "navigationBarTitleText": "霸王餐" } - ] + }] + }, + { + "root": "pagewriteoff", + "pages": [{ + "pageId": "PAGES_WEITEOFF", + "path": "index/index", + "style": { + "navigationBarTitleText": "核销列表" + } + }, { + "pageId": "PAGES_WEITEOFF_RECORD", + "path": "index/record", + "style": { + "navigationBarTitleText": "核销记录" + } + }] }, { "root": "pageBooking", @@ -877,11 +891,10 @@ } }, { - "path" : "quan/quan", + "path": "quan/quan", "pageId": "PAGES_ORDER_QUAN", - "style" : - { - "navigationBarTitleText" : "券包" + "style": { + "navigationBarTitleText": "券包" } } @@ -1094,44 +1107,42 @@ { "root": "pageNotification", "pages": [{ - "pageId": "PAGES_NOTIFICATION_INDEX", - "path": "index", - "style": { - "navigationBarTitleText": "订阅通知" - } + "pageId": "PAGES_NOTIFICATION_INDEX", + "path": "index", + "style": { + "navigationBarTitleText": "订阅通知" } - ] + }] }, { "root": "pageCreditBuyer", "pages": [{ - "pageId": "PAGES_CREDIT_BUYER_INDEX", - "path": "index", - "style": { - "navigationBarTitleText": "挂账管理" - } - },{ - "pageId": "PAGES_CREDIT_BUYER_ADDDEBTOR", - "path": "addDebtor", - "style": { - "navigationBarTitleText": "挂账人" - } - },{ - "pageId": "PAGES_CREDIT_BUYER_REPAYMENTRECORD", - "path": "rePaymentRecord", - "style": { - "navigationBarTitleText": "账单付款记录" - } - },{ - "pageId": "PAGES_CREDIT_BUYER_DETAIL", - "path": "creditDetail", - "style": { - "navigationBarTitleText": "查看明细" - } + "pageId": "PAGES_CREDIT_BUYER_INDEX", + "path": "index", + "style": { + "navigationBarTitleText": "挂账管理" } - ] + }, { + "pageId": "PAGES_CREDIT_BUYER_ADDDEBTOR", + "path": "addDebtor", + "style": { + "navigationBarTitleText": "挂账人" + } + }, { + "pageId": "PAGES_CREDIT_BUYER_REPAYMENTRECORD", + "path": "rePaymentRecord", + "style": { + "navigationBarTitleText": "账单付款记录" + } + }, { + "pageId": "PAGES_CREDIT_BUYER_DETAIL", + "path": "creditDetail", + "style": { + "navigationBarTitleText": "查看明细" + } + }] } - + ], "globalStyle": { "navigationBarTextStyle": "black", diff --git a/pages/index/index.vue b/pages/index/index.vue index 00559e2..e42a5a2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -284,8 +284,11 @@ // pageUrl: 'PAGES_RED_INDEX', // entId: 'ENT_MCH_MEMBER' // }, - - + { + title: '核销管理', + icon: '/static/indexImg/pagewriteoff.svg', + pageUrl: 'PAGES_WEITEOFF' + }, { title: '退出登录', icon: '/static/indexImg/icon-login-out.svg', @@ -373,6 +376,7 @@ /* #endif */ /* #ifndef H5 */ padding-top: calc(84rpx + 44px); + /* #endif */ >view { text-align: center; diff --git a/pagesCreateOrder/index/components/car.vue b/pagesCreateOrder/index/components/car.vue index 44f0f26..13e5a36 100644 --- a/pagesCreateOrder/index/components/car.vue +++ b/pagesCreateOrder/index/components/car.vue @@ -36,7 +36,7 @@ - {{item.number}} + {{(item.number).toFixed(2)}} diff --git a/pagesCreateOrder/index/components/list-goods-item.vue b/pagesCreateOrder/index/components/list-goods-item.vue index f5648ff..6cc9830 100644 --- a/pagesCreateOrder/index/components/list-goods-item.vue +++ b/pagesCreateOrder/index/components/list-goods-item.vue @@ -1,17 +1,20 @@