tianyi 1 month ago
parent
commit
802ce78def
  1. 34
      pages/shop/addGoods.vue

34
pages/shop/addGoods.vue

@ -31,9 +31,8 @@
<input type="digit" class="content-input" v-model="formData.orderFiled" placeholder="请输入排名"> <input type="digit" class="content-input" v-model="formData.orderFiled" placeholder="请输入排名">
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="商品分类" name="editTitle"> <uni-forms-item label="商品分类" name="editTitle">
<view style="border: 4rpx solid #eee;display: flex;flex: 1;border-radius: 10rpx;"> <view @click="goGategoryLow" style="height:70rpx;border: 4rpx solid #eee;display: flex;flex: 1;border-radius: 10rpx;">
<input type="text" placeholder="请选择商品分类" disabled v-model="typeItem.categoryName" <text class="content-input" style="height:70rpx;border: 0;">{{typeItem.categoryName}}</text>
class="content-input" @tap="goGategoryLow" style="border: 0;">
<uni-icons type="right" size="16" <uni-icons type="right" size="16"
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons> style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons>
</view> </view>
@ -117,7 +116,6 @@
<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"
@ -168,7 +166,7 @@
</template> </template>
<script> <script>
import SpEditor from '@/package2/components/sp-editor/components/sp-editor/sp-editor.vue' import SpEditor from '@/pages/sp-editor/components/sp-editor/sp-editor.vue'
export default { export default {
components: { components: {
@ -239,18 +237,7 @@
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
@ -386,22 +373,19 @@
// //
goGategoryLow() { goGategoryLow() {
uni.navigateTo({ uni.navigateTo({
url: '/package2/myCenter/addType' url: '/pages/shop/addType'
}) })
}, },
// //
getGategoryList() { getGategoryList() {
this.NB.sendRequest("/auth/getShopByUser", { this.NB.sendRequest("/app/productCategory/list", {
shopId:uni.getStorageSync('shopId') shopId:uni.getStorageSync('shopId')
}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { }, false, 'get', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.productCategoryList = Array.isArray(res.result) ? res.result : [] this.productCategoryList = Array.isArray(res.result) ? res.result : []
this.syncSelectedCategory() this.syncSelectedCategory()
} else { } else {
uni.showToast({ this.tui.toast(res.message)
title: res.message,
icon: 'none'
})
} }
}) })
}, },
@ -941,7 +925,7 @@
goAttributeList(){ goAttributeList(){
this.$refs.addTypeDialog.close() this.$refs.addTypeDialog.close()
uni.navigateTo({ uni.navigateTo({
url: '/package2/myCenter/attributeList?from=addGoods' url: '/pages/shop/attributeList?from=addGoods'
}) })
}, },
async upLoadFile(path) { async upLoadFile(path) {
@ -1012,9 +996,7 @@
} }
.back-btn { .back-btn {
position: absolute; padding-top: 110rpx;
bottom: 0;
left: 0;
} }
.title-name { .title-name {

Loading…
Cancel
Save