| | |
| | | shopnum: 0,
|
| | | }
|
| | | },
|
| | | onShow() { |
| | | if (this.id) { |
| | | this.getDetail() |
| | | onShow() {
|
| | | if (this.id) {
|
| | | this.getDetail()
|
| | | }
|
| | | this.refreshShopNum()
|
| | | },
|
| | |
| | | }
|
| | | this.refreshShopNum()
|
| | | },
|
| | | // #ifdef PUB_CUSTOMER
|
| | | onShareAppMessage() {
|
| | | let that = this;
|
| | | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO &&
|
| | | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || ''
|
| | | var url =
|
| | | `/sub_pages/customer/trade/detail?id=${this.id}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
|
| | | return {
|
| | |
|
| | | title: this.dto.id ? (this.dto.name + " " + (this.dto.price || '-') + '元/扎 ' + (this.dto.unit || '')) : "花满芫",
|
| | | path: url,
|
| | | }
|
| | | },
|
| | | onShareTimeline() {
|
| | | let that = this;
|
| | | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO &&
|
| | | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || ''
|
| | | var url =
|
| | | `/sub_pages/customer/trade/detail?id=${this.id}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
|
| | | return {
|
| | | title: this.dto.id ? (this.dto.name + " " + (this.dto.price || '-') + '元/扎 ' + (this.dto.unit || '')) : "花满芫",
|
| | | path: url,
|
| | | }
|
| | | },
|
| | | // #endif
|
| | | methods: {
|
| | | async updateItemNum(item) {
|
| | | const res = await this.$message.confirm('', {
|
| | |
| | |
|
| | | } else {
|
| | | if (!item.stock || t > item.stock) {
|
| | | this.$message.showToast('库存不足无法修改') |
| | | this.$message.showToast('库存不足无法修改')
|
| | | return
|
| | | }
|
| | | this.addnum(item, (t - item.shopnum))
|
| | |
| | | })
|
| | | this.$message.hideLoading()
|
| | | if (code === 0) {
|
| | | item.shopnum += addnum |
| | | item.shopnum += addnum
|
| | | this.refreshShopNum()
|
| | | this.$forceUpdate()
|
| | | }
|
| | | },
|
| | |
|
| | | async refreshShopNum() {
|
| | | this.shopnum = await this.$store.dispatch('countShopping'); |
| | | this.$store.dispatch('sign_add','shopnum') |
| | | |
| | | this.shopnum = await this.$store.dispatch('countShopping');
|
| | | this.$store.dispatch('sign_add', 'shopnum')
|
| | |
|
| | | },
|
| | | async collectItem(dto) {
|
| | | if (!this.currentInfo.id) {
|