tianyi 1 month ago
parent
commit
62af65a317
  1. 4
      pages/index/index.vue
  2. 7
      pages/login/login.vue
  3. 49
      pages/shop/addGoods.vue
  4. 82
      pages/shop/attributeList.vue
  5. 6
      pages/shop/goodsList.vue
  6. 2
      pages/shop/wallet.vue
  7. 2
      pages/worker/wallet.vue

4
pages/index/index.vue

@ -11,11 +11,11 @@
</view>
<view class="shop-title">
<view class="title1">
<image :src="shop.shopIcon" alt="" />
<image :src="shop?shop.shopIcon :''" alt="" />
</view>
<view class="title2">
<view class="title22" @tap="checkArea">
{{shop.shopName}}
{{shop?shop.shopName:''}}
<uni-icons type="right"></uni-icons>
</view>
<view class="title33" @tap="updateStatus">

7
pages/login/login.vue

@ -328,6 +328,13 @@
deviceId: res1.deviceId
}, false, 'POST', 'application/x-www-form-urlencoded').then(res => {
if (res.code == 200) {
if(res.result == null){
uni.showToast({
title: '暂无审核通过的商家',
icon: 'none'
})
return
}
uni.setStorageSync('type', item.type)
uni.setStorageSync('warehouseKeeperFlag', item.warehouseKeeperFlag)
uni.setStorageSync('shopId', item.id)

49
pages/shop/addGoods.vue

@ -117,6 +117,7 @@
<uni-forms-item label="详细图文" name="startPayNum">
<view class="xiangxi-box">
<sp-editor
:keys="keys"
@init="initEditor"
@input="inputOver"
@upinImage="upinImage"
@ -167,7 +168,7 @@
</template>
<script>
import SpEditor from '@/pages/sp-editor/components/sp-editor/sp-editor.vue'
import SpEditor from '@/package2/components/sp-editor/components/sp-editor/sp-editor.vue'
export default {
components: {
@ -238,12 +239,25 @@
onShow() {
this.attrId = uni.getStorageSync('attrId');
this.shopMerchantType = uni.getStorageSync('shopMerchantType');
uni.authorize({
scope: 'scope.writePhotosAlbum',
success() {
},
fail() {
uni.showToast({
title: "您未授权,图片上传功能可能会出现错误",
icon: 'none'
})
}
})
if (this.hasSelectedTypeItem(this.typeItem)) {
this.typeItem = JSON.parse(JSON.stringify(this.typeItem))
this.formData.categoryId = this.typeItem.id
this.formData.categoryName = this.typeItem.categoryName
this.syncSelectedCategory()
} else {
this.syncSelectedCategory()
}
this.formData.shopId = uni.getStorageSync('shopId')
},
@ -253,7 +267,7 @@
this.dataList = JSON.parse(option.dataList)
this.NB.sendRequest("/app/product/getById/" + this.dataList.id, {
}, false, 'POST', 'application/x-www-form-urlencoded').then((res) => {
}, false, 'post', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
this.modalType = 1
this.formData.id = res.result.id
@ -372,7 +386,7 @@
//
goGategoryLow() {
uni.navigateTo({
url: '/pages/shop/addType'
url: '/package2/myCenter/addType'
})
},
//
@ -395,7 +409,7 @@
return value !== '' && value !== undefined && value !== null
},
hasSelectedTypeItem(item) {
return item && this.hasCategoryValue(item.id)
return item && this.hasCategoryValue(item.id) && this.hasCategoryValue(item.categoryName)
},
syncSelectedCategory() {
if (this.hasCategoryValue(this.formData.categoryId)) {
@ -457,13 +471,8 @@
icon: 'none'
})
uni.navigateBack()
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
}).catch(() => {});
})
} else if (this.modalType == 1) {
//
this.formData.attributeListPrice = JSON.stringify(this.formData.attributeListPrice)
@ -477,13 +486,8 @@
icon: 'none'
})
uni.navigateBack()
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
}).catch(() => {});
})
}
// }
// });
@ -523,6 +527,7 @@
}
const startPayNum = String(this.formData.startPayNum).trim()
if (startPayNum !== '' && !this.isValidInteger(startPayNum)) {
uni.showToast({
title: '起售数量只能输入整数',
icon: 'none'
@ -820,9 +825,7 @@
let that = this
this.$refs.addTypeDialog.open()
this.modalclassType = type
this.NB.sendRequest("/app/productAttribute/selectByCategoryId", {
categoryId:that.attrId,
}, false, 'post', 'application/x-www-form-urlencoded').then((res) => {
this.NB.sendRequest("/app/productAttribute/selectByCategoryId", {categoryId:that.attrId}, false, 'post', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
that.categoryData = res.result
if (that.categoryData.length == 0) {
@ -848,13 +851,11 @@
icon: 'none'
})
}
}).catch(() => {});
})
},
getCateGorySon(id){
let that = this
this.NB.sendRequest("/app/productAttributeValue/selectByAttributeId", {
id: id,
}, false, 'get', 'application/x-www-form-urlencoded').then((res) => {
this.NB.sendRequest("/app/productAttributeValue/selectByAttributeId", {}, false, 'get', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
that.categorySonData = res.result
for (var i = 0; i < that.categorySonData.length; i++) {
@ -927,7 +928,7 @@
goAttributeList(){
this.$refs.addTypeDialog.close()
uni.navigateTo({
url: '/pages/shop/attributeList'
url: '/package2/myCenter/attributeList?from=addGoods'
})
},
async upLoadFile(path) {

82
pages/shop/attributeList.vue

@ -18,15 +18,14 @@
<li v-for="(item, index) in indexList" :key="index" @tap="clickList(item)">
<view class="name">
<text>{{item.attributeName}}</text>
<view style="width: 10px;"></view>
<view @click.stop="inputDialogToggle('edit', item)">
<uni-icons type="compose" size="22" v-if="item.attributeName != '默认属性'"></uni-icons>
</view>
<u-icon name="edit-pen-fill" size="22" v-if="item.attributeName != '默认属性'" @tap.stop="inputDialogToggle('edit', item)"></u-icon>
</view>
<button class="bj-btn" @tap.stop="goGategoryLow(item)">管理属性</button>
</li>
</ul>
</view>
<u-modal :show="show" :title="'删除'" :content="'是否确认删除此属性?'" showCancelButton="true" @cancel="show = false"
@confirm="delItemModal"></u-modal>
<uni-popup ref="delDialog" background-color="#fff">
<view class="add-popup-content attr-name-popup">
<view class="add-popup-title">
@ -331,7 +330,8 @@
attrId:'',
valueEditId:'',
isEdieValue:false,
multipleList:[]
multipleList:[],
fromPage:''
}
},
computed: {
@ -353,6 +353,9 @@
this.attrId = uni.getStorageSync('attrId');
this.getGategoryList()
},
onLoad(option) {
this.fromPage = option.from || ''
},
methods: {
editValue(item){
this.isEdieValue = true
@ -373,13 +376,11 @@
this.$forceUpdate()
} else {
uni.showToast({
title: "删除失败",
title: "添加失败",
icon: 'none'
})
return;
}
uni.hideLoading();
}).catch((res) => {});
})
},
//
getGategoryList() {
@ -394,8 +395,7 @@
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
})
},
//
inputDialogToggle(type, item, parent) {
@ -437,56 +437,34 @@
} else {
this.NB.sendRequest("/app/productAttribute/selectByCategoryId", {
categoryId: this.delItems.id
}, false, 'post', 'application/x-www-form-urlencoded').then((res1) => {
}, false, 'post', 'application/x-www-form-urlencoded').then((res) => {
if (res1.code == 200) {
if (res1.result.length > 0) {
uni.showModal({
title: "提示",
content: "此属性已经维护了子属性,确定继续删除吗?",
confirmText: '取消',
cancelText: '确认',
success: function(res2) {
if (res2.cancel) {
if (res2.confirm) {
that.delItemModal()
}
}
})
} else {
uni.showModal({
title: "提示",
content: "是否确认删除此属性?",
confirmText: '取消',
cancelText: '确认',
success: function(res3) {
if (res3.cancel) {
that.delItemModal()
that.show = true
}
}
})
}
} else {
uni.showToast({
title: res1.message,
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
}
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
},
//
clickList(item) {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
if (this.fromPage != 'addGoods') {
prevPage.$vm.typeItem = item
}
uni.navigateBack({
delta: 1
})
@ -523,12 +501,11 @@
that.$forceUpdate()
} else {
uni.showToast({
title: res.message,
title: "添加失败",
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
})
}else{
this.NB.sendRequest("/app/productAttributeValue/save", {
attributeId: that.editItem.id,
@ -548,8 +525,7 @@
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
})
}
},
//
@ -590,9 +566,7 @@
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
})
that.typeText = ''
that.multipleList = []
break;
@ -614,8 +588,7 @@
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
})
break;
default:
}
@ -647,8 +620,7 @@
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
})
},
delItemModal() {
this.show = false;
@ -664,14 +636,14 @@
})
this.$refs.carPopup.close()
this.$refs.delDialog.close()
} else {
uni.showToast({
title: "删除失败",
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
})
}
},
delItem(item, type) {
@ -684,7 +656,7 @@
this.editItem = item
this.NB.sendRequest("/app/productAttributeValue/selectByAttributeId", {
id: item.id,
}, false, 'get', 'application/x-www-form-urlencoded').then((res) => {
}, false, 'post', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
this.defaultList = res.result;
this.$refs.attrValueDialog.open();
@ -694,8 +666,8 @@
icon: 'none'
})
}
uni.hideLoading();
}).catch((res) => {});
})
},
//
addMultipleType(item,item1,index){

6
pages/shop/goodsList.vue

@ -343,11 +343,11 @@
goDetail(type,item){
let url=""
if(type == 'goods'){
url = '/package2/myCenter/addGoods?dataList='+ JSON.stringify(item)
url = '/pages/shop/addGoods?dataList='+ JSON.stringify(item)
}else if(type == 'type'){
url = '/package2/myCenter/addType'
url = '/pages/shop/addType'
}else{
url = '/package2/myCenter/attributeList'
url = '/pages/shop/attributeList'
}
uni.navigateTo({
url:url

2
pages/shop/wallet.vue

@ -559,7 +559,7 @@
if (res.code == 200 && res.result) {
this.skipWalletRefreshOnShow = true
uni.navigateTo({
url: '/package3/shop/orderDetail?id=' + res.result,
url: '/pages/shop/orderDetail?id=' + res.result,
fail: () => {
this.skipWalletRefreshOnShow = false
}

2
pages/worker/wallet.vue

@ -560,7 +560,7 @@
if (res.code == 200 && res.result) {
this.skipWalletRefreshOnShow = true
uni.navigateTo({
url: '/package3/shop/orderDetail?id=' + res.result,
url: '/pages/shop/orderDetail?id=' + res.result,
fail: () => {
this.skipWalletRefreshOnShow = false
}

Loading…
Cancel
Save