From c0e156747c83c0a1848e5f457d0116e8fef51767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com> Date: Fri, 10 Dec 2021 10:00:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 1 - api/user.js | 12 + components/sSwiper.vue | 66 +++ components/vSwiper.vue | 99 ++++ config/index.js | 4 +- main.js | 3 + pages/demandHall/resourcesDetail/index.vue | 85 +-- pages/home/index.vue | 1 + pages/life/addGoods/index.vue | 89 ++-- pages/life/index.vue | 2 +- pages/life/temp/index.vue | 105 +--- pages/life/tempList/index.vue | 48 +- pages/order/OrderSubmission/index.vue | 11 +- pages/shop/GoodsCon/index.vue | 18 +- pages/user/agreement/index.vue | 482 +++++++++--------- pages/user/goodsManage/index.vue | 11 +- pages/user/index.vue | 7 +- pages/user/openStore/index.vue | 2 +- static/images/edit-icon.png | Bin 0 -> 646 bytes uni_modules/uni-badge/changelog.md | 22 + .../components/uni-badge/uni-badge.vue | 253 +++++++++ uni_modules/uni-badge/package.json | 88 ++++ uni_modules/uni-badge/readme.md | 58 +++ 23 files changed, 989 insertions(+), 478 deletions(-) create mode 100644 components/sSwiper.vue create mode 100644 components/vSwiper.vue create mode 100644 static/images/edit-icon.png create mode 100644 uni_modules/uni-badge/changelog.md create mode 100644 uni_modules/uni-badge/components/uni-badge/uni-badge.vue create mode 100644 uni_modules/uni-badge/package.json create mode 100644 uni_modules/uni-badge/readme.md diff --git a/App.vue b/App.vue index 3783774..498da52 100644 --- a/App.vue +++ b/App.vue @@ -251,7 +251,6 @@ export default { setMenuHeight() { uni.getSystemInfo({ success: res => { - console.log(res); this.globalData.navTopHeight = res.statusBarHeight; this.globalData.CustomBar = res.statusBarHeight + 45; this.globalData.systemInfo = res; diff --git a/api/user.js b/api/user.js index 95c245d..2f3ff4d 100644 --- a/api/user.js +++ b/api/user.js @@ -31,6 +31,12 @@ export function addTemp(data) { login: true, }) } +//删除运费模板 +export function delTemp(data) { + return request.delete('/user/shippingtemplate?ids=' + data, { + login: true, + }) +} //获取运费模板列表 export function getTempList(data) { @@ -38,6 +44,12 @@ export function getTempList(data) { login: true, }) } +//获取运费模板详情 +export function getTempDetail(data) { + return request.get('/user/shippingtemplate/getTemplatesDetail?id='+data, { + login: true, + }) +} /** * 用户登录 diff --git a/components/sSwiper.vue b/components/sSwiper.vue new file mode 100644 index 0000000..d6d0b49 --- /dev/null +++ b/components/sSwiper.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/components/vSwiper.vue b/components/vSwiper.vue new file mode 100644 index 0000000..0ed0c6c --- /dev/null +++ b/components/vSwiper.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/config/index.js b/config/index.js index dbb5bee..844be21 100644 --- a/config/index.js +++ b/config/index.js @@ -1,8 +1,8 @@ // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api' // export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api' -// export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api' -export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api' +export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api' +// export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api' // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api' // export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api'; diff --git a/main.js b/main.js index da7db6c..48c4502 100644 --- a/main.js +++ b/main.js @@ -45,6 +45,9 @@ Object.defineProperty(Vue.prototype, '$yroute', { }, }) +console.log(Vue.prototype) +console.log(Object.getPrototypeOf(Vue)) + let deviceType = '' // #ifdef APP-PLUS // App平台编译的代码 diff --git a/pages/demandHall/resourcesDetail/index.vue b/pages/demandHall/resourcesDetail/index.vue index 8785563..038e1c3 100644 --- a/pages/demandHall/resourcesDetail/index.vue +++ b/pages/demandHall/resourcesDetail/index.vue @@ -49,13 +49,8 @@ - - - - - - - + + 立即沟通 @@ -66,7 +61,8 @@ @@ -324,29 +274,4 @@ export default { color: #707070; line-height: 40rpx; } - -.swiper-block { - height: 300rpx; - width: 100%; -} - -.swiper-item { - display: flex; - flex-direction: column; - justify-content: center; - align-items: flex-start; - overflow: unset; -} -.slide-image { - height: 250rpx; - width: 520rpx; - border-radius: 9rpx; - margin: 0rpx 30rpx; - z-index: 1; -} -.active { - transform: scale(1.14); - transition: all 0.2s ease-in 0s; - z-index: 20; -} \ No newline at end of file diff --git a/pages/home/index.vue b/pages/home/index.vue index e65df47..2652fac 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -231,6 +231,7 @@ export default { } }, onLoad() { + uni.hideTabBar(); // app.globalData.editTabbar(); this.pagePath = '/pages/home/index' diff --git a/pages/life/addGoods/index.vue b/pages/life/addGoods/index.vue index 303e18c..2537788 100644 --- a/pages/life/addGoods/index.vue +++ b/pages/life/addGoods/index.vue @@ -89,7 +89,7 @@ - + 提交 @@ -237,6 +237,8 @@ this.attrArr = info.items this.spec_type = 1 this.isShow = info.is_show + this.tempId = info.shippingTemplatesDto.id + this.temp = info.name let strArr = info.items.map(item=>{ return item.value }) @@ -291,6 +293,9 @@ this.addOptionsDialog = true }, delAttr(i){ + if(this.attrArr.length == 1){ + return this.alertMessage('至少有一个规格') + } this.attrArr.splice(i,1) this.getFormatAttr() }, @@ -303,19 +308,19 @@ ///添加属性提交 submitAddAttr(){ if(this.attr.value == ''){ - return uni.showToast({ - title: '请填写属性名称!', - icon: 'none' - }) + return this.alertMessage('请填写属性名称','none') } try{ var o = this.attr.detail; + if(o.length == 0){ + throw "请至少填写一个属性值!"; + } o.forEach(function(item,index) { if(item == ""){ - throw "属性规格不能为空!"; + throw "属性值不能为空!"; } }); - }catch(e){ + } catch(e){ uni.showToast({ title: e, icon: 'none' @@ -337,19 +342,13 @@ if(res.success){ this.$set(this.batchData,'priceArr',res.data.value) if(res.data.attr){ - let strArr = res.data.attr.map(item=>{ - return item.value - }) + let strArr = res.data.attr.map(item=> item.value) this.$set(this.batchData,'titleStr',strArr.join('/')) } else{ this.$set(this.batchData,'titleStr','') } - } else{ - uni.showToast({ - title: res.msg, - icon: 'none' - }) + this.alertMessage(res.msg) } }) }, @@ -391,7 +390,6 @@ } else{ this.attrValTitle = '批量修改规格' } - this.showAttrVal= true }, cancelClick(){ @@ -400,7 +398,7 @@ }, submitClick(){ const idx = this.idx - console.log(this.price,this.ot_price,this.stock) + // console.log(this.price,this.ot_price,this.stock) if(this.stock == 0){ return this.alertMessage('商品库存不能为0') } @@ -414,9 +412,6 @@ this.$set(this.batchData.priceArr[idx],'price',this.price) this.$set(this.batchData.priceArr[idx],'ot_price',this.ot_price) this.$set(this.batchData.priceArr[idx],'stock',this.stock) - // this.batchData.priceArr[idx].price= this.price - // this.batchData.priceArr[idx].ot_price= this.ot_price - // this.batchData.priceArr[idx].stock= this.stock } this.showAttrVal= false }, @@ -436,77 +431,59 @@ isShow: this.isShow, items: this.items } + console.log(form.slider_image[0]) if(form.store_name == ''){ - this.alertMessage('请填写商品名称') - return - } else if(form.slider_image[0] == ''){ - this.alertMessage('请至少上传一张商品图片') - return + return this.alertMessage('请填写商品名称','none') + } else if(form.slider_image[0]){ + return this.alertMessage('请至少上传一张商品图片','none') } else if(form.description == ''){ - this.alertMessage('请填写商品详情') - return + return this.alertMessage('请填写商品详情','none') } else if(form.description == ''){ - this.alertMessage('请填写商品详情') - return + return this.alertMessage('请填写商品详情','none') } form.attrs.forEach((item,index)=>{ if(item.price == '' || item.price == 0){ - this.alertMessage('请商品规格价格') - return + return this.alertMessage('请商品规格价格','none') } else if(item.stock == '' || item.stock == 0){ - this.alertMessage('库存不能为0') - return + return this.alertMessage('商品规格库存不能为0','none') } }) if(this.id != ''){ form.id = this.id form.spec_type = this.spec_type - console.log(form) editProduct(form).then((res)=>{ if(res.success){ - uni.showToast({ - title: res.msg, - duration: 1500 - }) + this.alertMessage(res.msg,'success') setTimeout((res)=>{ uni.redirectTo({ - url: '/pages/user/goodsManage/index' + url: '/pages/user/goodsManage/index?type=' + 0 }); },1500) } else{ - uni.showToast({ - title: res.msg, - icon: 'none' - }) + this.alertMessage(res.msg,'none') } }) } else{ form.spec_type = this.batchData.priceArr.length > 1 ? 1 : 0 - console.log(form) addProduct(form).then((res)=>{ if(res.success){ - uni.showToast({ - title: res.msg, - duration: 1500 - }) + this.alertMessage(res.msg,'success') setTimeout((res)=>{ uni.redirectTo({ - url: '/pages/user/goodsManage/index' + url: '/pages/user/goodsManage/index?type=' + 0 }); },1500) } else{ - uni.showToast({ - title: res.msg, - icon: 'none' - }) + this.alertMessage(res.msg,'none') } }) } }, - alertMessage(msg){ + alertMessage(msg,type){ uni.showToast({ title: msg, - icon: 'none' + icon: type, + duration: 1500 }) } } diff --git a/pages/life/index.vue b/pages/life/index.vue index 8859db7..a873776 100644 --- a/pages/life/index.vue +++ b/pages/life/index.vue @@ -179,7 +179,7 @@ export default { } else{ this.flowList = res.data } - this.isLoad = this.limit <= res.data.length + // this.isLoad = this.limit <= res.data.length if(this.limit <= res.data.length){ //分页数等于返回值的length说明还有 this.isLoad = true } else{ diff --git a/pages/life/temp/index.vue b/pages/life/temp/index.vue index d49b9d7..a75615b 100644 --- a/pages/life/temp/index.vue +++ b/pages/life/temp/index.vue @@ -22,9 +22,9 @@ 阶梯运费 - + - + {{type == 0 ? '件' : 'kg' }}内(含)¥ @@ -87,76 +87,8 @@ const app = getApp(); import selectTree from "@/components/select-tree/select-tree" import tkiTree from "@/components/tki-tree/tki-tree.vue" -import { getCity, citys, addTemp } from "@/api/user"; +import { getCity, citys, addTemp, getTempDetail } from "@/api/user"; -let testList = [ - { - city_id: 1, - id: 1, - isShow: 1, - lat: "39.904030", - level: 0, - lng: "116.407526", - mergerName: "北京", - name: "北京市", - parentId: 0, - children: [ - { - areaCode: "110100000000", - children: null, - city_id: 2, - id: 35, - isShow: 1, - lat: "39.904030", - level: 1, - lng: "116.407526", - mergerName: "北京", - name: "北京市", - parentId: 1, - }, - ] - }, - { - areaCode: "130000000000", - children: [ - { - areaCode: "130100000000", - children: null, - city_id: 13268, - id: 37, - isShow: 1, - lat: "38.042306", - level: 1, - lng: "114.514859", - mergerName: "河北,石家庄", - name: "石家庄市", - parentId: 13267, - }, - { - areaCode: "130200000000", - children: null, - city_id: 18128, - id: 38, - isShow: 1, - lat: "39.630867", - level: 1, - lng: "118.180193", - mergerName: "河北,唐山", - name: "唐山市", - parentId: 13267, - } - ], - city_id: 13267, - id: 3, - isShow: 1, - lat: "38.037057", - level: 0, - lng: "114.468664", - mergerName: "河北", - name: "河北省", - parentId: 0, - } - ] var g = [ { region: [ @@ -182,17 +114,36 @@ export default { name: "", type:0, setpFreight: false, - list: testList, - templateList: g + list: [], + templateList: g, + id: null }; }, mounted(){ + if(this.$yroute.query.id){ + this.id = this.$yroute.query.id + this.getTempDetail(this.$yroute.query.id) + } citys().then((res)=>{ let data = res.data; this.list = data }) }, methods: { + getTempDetail(id){ + getTempDetail(id).then((res)=>{ + if(res.success){ + this.name= res.data.name + this.type= res.data.type + this.templateList = res.data.region_info + this.templateList.forEach((item)=>{ + item.setpFreight = true + }) + } else{ + this.alertMessage(res.msg) + } + }) + }, radioChange(e){ this.type = e.detail.value }, @@ -208,13 +159,13 @@ export default { this.$refs.tkitree._show(); }, delTempItem(idx){ - console.log(idx) this.templateList.splice(idx,1) }, // 确定回调事件 treeConfirm(e) { - // console.log(e,'确认') - // console.log(this.list,'列表') + console.log(e,'确认') + console.log(this.list,'列表') + if(e.length == 0) return let list = this.list; let selectCity = e; let selectName = []; @@ -260,13 +211,13 @@ export default { // 取消回调事件 treeCancel(e) { console.log(e) - }, submit(){ let form = {} form.name = this.name form.type = this.type form.region_info = this.templateList + form.id = this.id if(form.name == '' ){ return this.alertMessage('请填写模板名字') diff --git a/pages/life/tempList/index.vue b/pages/life/tempList/index.vue index 7d0d736..af5a311 100644 --- a/pages/life/tempList/index.vue +++ b/pages/life/tempList/index.vue @@ -5,8 +5,13 @@ {{index + 1}}、{{item.name}} - - + + + + + + + @@ -15,7 +20,7 @@ \ No newline at end of file + .pay-box .img2 { + height: 1235rpx; + } + diff --git a/pages/user/goodsManage/index.vue b/pages/user/goodsManage/index.vue index 0ff4540..5fdb2d7 100644 --- a/pages/user/goodsManage/index.vue +++ b/pages/user/goodsManage/index.vue @@ -1,10 +1,10 @@