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. 88
      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>
<view class="shop-title"> <view class="shop-title">
<view class="title1"> <view class="title1">
<image :src="shop.shopIcon" alt="" /> <image :src="shop?shop.shopIcon :''" alt="" />
</view> </view>
<view class="title2"> <view class="title2">
<view class="title22" @tap="checkArea"> <view class="title22" @tap="checkArea">
{{shop.shopName}} {{shop?shop.shopName:''}}
<uni-icons type="right"></uni-icons> <uni-icons type="right"></uni-icons>
</view> </view>
<view class="title33" @tap="updateStatus"> <view class="title33" @tap="updateStatus">

7
pages/login/login.vue

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

49
pages/shop/addGoods.vue

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

88
pages/shop/attributeList.vue

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

6
pages/shop/goodsList.vue

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

2
pages/shop/wallet.vue

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

2
pages/worker/wallet.vue

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

Loading…
Cancel
Save