|
|
@@ -50,10 +50,16 @@
|
|
|
</van-sticky>
|
|
|
<div class="list-content">
|
|
|
<div class="procuct" v-for="(item, index) in list" :key="index">
|
|
|
- <van-icon color="#C8C9CC" class="check" name="circle" size="18px" />
|
|
|
- <product-info :info="item" :isMine="isMineShop" :showBtn="isManage"></product-info>
|
|
|
+ <van-icon
|
|
|
+ v-if="isManage"
|
|
|
+ :color="checkChoose(item.id) ? $colors.prim : '#C8C9CC'"
|
|
|
+ class="check"
|
|
|
+ :name="checkChoose(item.id) ? 'checked' : 'circle'"
|
|
|
+ size="18px"
|
|
|
+ />
|
|
|
+ <product-info :info="item" :isMine="isMineShop" :showBtn="isManage" @click="choose"></product-info>
|
|
|
</div>
|
|
|
-
|
|
|
+ <van-icon name="checked" />
|
|
|
<van-empty
|
|
|
v-if="empty"
|
|
|
image="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/kong_png_wukabao.png"
|
|
|
@@ -65,14 +71,14 @@
|
|
|
|
|
|
<div class="bottom">
|
|
|
<block v-if="isManage">
|
|
|
- <button-bg type="warning" openType="share">新增商品 </button-bg>
|
|
|
- <button-bg type="prim" isRight v-if="chooseIds.length > 0">删除</button-bg>
|
|
|
+ <button-bg type="warning">新增商品 </button-bg>
|
|
|
+ <button-bg type="prim" isRight v-if="chooseIds.length > 0" @click="del">删除</button-bg>
|
|
|
<button-bg type="prim" isRight v-else @click="isManage = false">完成</button-bg>
|
|
|
</block>
|
|
|
<block v-else>
|
|
|
<button-bg type="warning" openType="share">分享店铺 </button-bg>
|
|
|
<button-bg type="prim" isRight v-if="isMineShop" @click="isManage = true">管理商品</button-bg>
|
|
|
- <button-bg type="prim" isRight v-else @click="wait">联系他</button-bg>
|
|
|
+ <button-bg type="prim" isRight v-else @click="chatWith">联系他</button-bg>
|
|
|
</block>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -165,30 +171,63 @@ export default {
|
|
|
changeStatus(value) {
|
|
|
console.log(value);
|
|
|
this.caseStatus = value.detail;
|
|
|
+ this.sort = '';
|
|
|
this.getData();
|
|
|
},
|
|
|
getData() {
|
|
|
this.empty = false;
|
|
|
let data = {
|
|
|
- storeId: this.storeInfo.id,
|
|
|
- caseStatus: this.caseStatus
|
|
|
+ storeId: this.storeInfo.id
|
|
|
};
|
|
|
+ if (this.caseStatus) {
|
|
|
+ data.caseStatus = this.caseStatus;
|
|
|
+ }
|
|
|
if (this.sort) {
|
|
|
data.sortStr = this.sort;
|
|
|
}
|
|
|
this.showLoading();
|
|
|
- this.$http.post('/store/findStoreCases', data).then(res => {
|
|
|
+ return this.$http.post('/store/findStoreCases', data).then(res => {
|
|
|
this.list = res.caseInfo;
|
|
|
if (res.caseInfo.length == 0) {
|
|
|
this.empty = true;
|
|
|
}
|
|
|
this.hideLoading();
|
|
|
+ return Promise.resolve();
|
|
|
});
|
|
|
},
|
|
|
+ del() {
|
|
|
+ this.$http
|
|
|
+ .get('/cardCase/multipleDelete', {
|
|
|
+ caseIds: this.chooseIds
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ return this.getData();
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.toast('删除成功', 'success');
|
|
|
+ this.chooseIds = [];
|
|
|
+ });
|
|
|
+ },
|
|
|
goNext() {
|
|
|
if (this.isMineShop) {
|
|
|
this.navigateTo('/pages/store/setting');
|
|
|
}
|
|
|
+ },
|
|
|
+ chatWith() {
|
|
|
+ this.navigateTo('/pages/chat?toUserId=' + this.storeInfo.userId + '&toName=' + this.storeInfo.storeName);
|
|
|
+ },
|
|
|
+ checkChoose(id) {
|
|
|
+ let list = [...this.chooseIds];
|
|
|
+ return list.includes(id);
|
|
|
+ },
|
|
|
+ choose(id) {
|
|
|
+ let list = [...this.chooseIds];
|
|
|
+ if (this.checkChoose(id)) {
|
|
|
+ list.splice(list.indexOf(id), 1);
|
|
|
+ } else {
|
|
|
+ list.push(id);
|
|
|
+ }
|
|
|
+ this.chooseIds = list;
|
|
|
}
|
|
|
},
|
|
|
onPageScroll() {},
|