|
|
@@ -8,19 +8,22 @@
|
|
|
</view>
|
|
|
<scroll-view scroll-y scroll-with-animation class="main-view">
|
|
|
<view class="space-view ex-table">
|
|
|
- <view style="line-height:55upx;" v-if="!$util.isEmpty(selectList)">
|
|
|
- <text v-for="(item, index) in selectList" :key="index" style="margin-right:36upx;font-size:30upx;" @click="delProduct(item)">{{ item.name }} {{ item.bigCount }} x</text>
|
|
|
- <button @click="confirmChange()" class="admin-button-com blue mini-btn">确认添加</button>
|
|
|
- </view>
|
|
|
<t-table :headerBackgroundColor="'#F0F2F6'">
|
|
|
+ <t-tr header>
|
|
|
+ <t-th>图片</t-th>
|
|
|
+ <t-th><view style="width:230upx;">名称</view></t-th>
|
|
|
+ <t-th>价格</t-th>
|
|
|
+ <t-th>数量</t-th>
|
|
|
+ <t-th>操作</t-th>
|
|
|
+ </t-tr>
|
|
|
<block v-if="!$util.isEmpty(list.data)">
|
|
|
<block v-for="(productItem, productIndex) in list.data" :key="productIndex">
|
|
|
<t-tr>
|
|
|
<t-td>
|
|
|
- <image :src="productItem.smallCover" style="width:90upx;height:90upx;" @click="pageTo({url:'/admin/item/detail?id='+productItem.id})"></image>
|
|
|
+ <image :src="productItem.smallCover" style="width:80upx;height:80upx;" @click="pageTo({url:'/admin/item/detail?id='+productItem.id})"></image>
|
|
|
</t-td>
|
|
|
<t-td>
|
|
|
- <view style="width:250upx;text-align:left;color:black;font-size:30upx;word-wrap: break-word;font-weight:bold;"
|
|
|
+ <view style="width:230upx;text-align:left;color:black;font-size:30upx;word-wrap: break-word;font-weight:bold;"
|
|
|
@click="pageTo({url:'/admin/item/detail?id='+productItem.id})">
|
|
|
<text style="color:#3385ff;margin-right:3upx;" v-if="productItem.frontHide == 1">隐</text>
|
|
|
{{productItem.name}}
|
|
|
@@ -28,7 +31,10 @@
|
|
|
</view>
|
|
|
</t-td>
|
|
|
<t-td>
|
|
|
- <input type="number" v-model="productItem.bigCount" class="inp-input" style="border:1upx solid #CCCCCC;font-size:29upx;color:black;width:100upx;" />
|
|
|
+ <input type="digit" v-model="productItem.showUsePrice" class="inp-input" placeholder="价格" style="border:1upx solid #CCCCCC;font-size:24upx;color:black;" />
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <input type="number" v-model="productItem.bigCount" class="inp-input" placeholder="数量" style="border:1upx solid #CCCCCC;font-size:24upx;color:black;width:100upx;" />
|
|
|
</t-td>
|
|
|
<t-td>
|
|
|
<button @click="tjItem(productItem)" class="admin-button-com blue middle">添加</button>
|
|
|
@@ -40,6 +46,11 @@
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view class="app-footer">
|
|
|
+ <button class="admin-button-com big blue" @click="goBack()" style="width:400upx;">返回</button>
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -105,26 +116,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- confirmChange(){
|
|
|
- let that = this
|
|
|
- if(this.$util.isEmpty(this.selectList)){
|
|
|
- this.$msg('请选择花材')
|
|
|
- return false
|
|
|
- }
|
|
|
- let id = this.option.id ? this.option.id : 0
|
|
|
- that.$util.confirmModal({content:'确认提交?'},() => {
|
|
|
- addItem({data:JSON.stringify(that.selectList),id:id}).then(res=>{
|
|
|
- if(res.code == 1){
|
|
|
- that.removeFromSaveDirect()
|
|
|
-
|
|
|
- let pages = getCurrentPages();
|
|
|
- let prevPage = pages[ pages.length - 2 ];
|
|
|
- prevPage.$vm.addSelectItem = 1
|
|
|
- uni.navigateBack()
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
delProduct(item){
|
|
|
let that = this
|
|
|
that.$util.confirmModal({content:'确认删除?'},() => {
|
|
|
@@ -132,11 +123,24 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
tjItem(item){
|
|
|
- this.customData = item
|
|
|
- this.customData.userPrice = 0.1
|
|
|
- this.confirmAddItemModel(this.customData)
|
|
|
+ let that = this
|
|
|
+ let id = this.option.id ? this.option.id : 0
|
|
|
+ let data = [{id:item.id,bigCount:item.bigCount,price:item.showUsePrice}]
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ addItem({data:JSON.stringify(data),id:id}).then(res=>{
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code == 1){
|
|
|
+ that.$msg('添加成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
item.bigCount=''
|
|
|
- this.$forceUpdate()
|
|
|
+ item.showUsePrice = ''
|
|
|
+ },
|
|
|
+ goBack(){
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let prevPage = pages[ pages.length - 2 ];
|
|
|
+ prevPage.$vm.addSelectItem = 1
|
|
|
+ uni.navigateBack()
|
|
|
},
|
|
|
init(){
|
|
|
|