合并冲突
@@ -16,7 +16,7 @@
|
|||||||
v-if="cart.productInfo.attrInfo"
|
v-if="cart.productInfo.attrInfo"
|
||||||
>{{ cart.productInfo.attrInfo.sku }}</view>
|
>{{ cart.productInfo.attrInfo.sku }}</view>
|
||||||
<view class="money font-color-red">¥{{ cart.truePrice }}</view>
|
<view class="money font-color-red">¥{{ cart.truePrice }}</view>
|
||||||
<view class="evaluate" v-if="evaluate == 3" @click="routerGo(cart)">评价</view>
|
<view class="evaluate" v-if="evaluate == 3 && cart.isReply==0" @click="routerGo(cart)">评价</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -6,13 +6,11 @@
|
|||||||
<text class="iconfont icon-zhuangshixian lefticon"></text>
|
<text class="iconfont icon-zhuangshixian lefticon"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="recommendList acea-row row-between-wrapper">
|
<view class="recommendList acea-row row-between-wrapper">
|
||||||
<view
|
<view @click="routerGo(item)" class="item" v-for="(item, recommendIndex) in hostProduct"
|
||||||
@click="routerGo(item)"
|
:key="recommendIndex">
|
||||||
class="item"
|
<view class="pictrue">
|
||||||
v-for="(item, recommendIndex) in hostProduct"
|
<image :src="item.image" class="image" />
|
||||||
:key="recommendIndex"
|
</view>
|
||||||
>
|
|
||||||
<view class="pictrue"><image :src="item.image" class="image" /></view>
|
|
||||||
<view class="name line1">{{ item.storeName }}</view>
|
<view class="name line1">{{ item.storeName }}</view>
|
||||||
<view class="money font-color-red">
|
<view class="money font-color-red">
|
||||||
¥
|
¥
|
||||||
@@ -24,47 +22,61 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getHostProducts } from '@/api/store';
|
import {
|
||||||
import Loading from '@/components/Loading';
|
getHostProducts
|
||||||
export default {
|
} from '@/api/store';
|
||||||
name: 'Recommend',
|
import Loading from '@/components/Loading';
|
||||||
props: {},
|
export default {
|
||||||
components: {
|
name: 'Recommend',
|
||||||
Loading
|
props: {
|
||||||
},
|
recommendLoading: Boolean
|
||||||
data: function() {
|
|
||||||
return {
|
|
||||||
hostProduct: [],
|
|
||||||
page: 1,
|
|
||||||
limit: 20,
|
|
||||||
loadTitle: '',
|
|
||||||
loading: false,
|
|
||||||
loadend: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted: function() {
|
|
||||||
this.hostProducts();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
routerGo(item) {
|
|
||||||
this.$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } });
|
|
||||||
},
|
},
|
||||||
hostProducts: function() {
|
components: {
|
||||||
let that = this;
|
Loading
|
||||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
},
|
||||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
watch: {
|
||||||
that.loading = true;
|
recommendLoading(nextLoading) {
|
||||||
getHostProducts(that.page, that.limit).then(res => {
|
if (nextLoading) {
|
||||||
that.loading = false;
|
this.hostProducts()
|
||||||
//apply();js将一个数组插入另一个数组;
|
}
|
||||||
that.hostProduct.push.apply(that.hostProduct, res.data);
|
}
|
||||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
},
|
||||||
that.page = that.page + 1;
|
data: function () {
|
||||||
});
|
return {
|
||||||
}
|
hostProduct: [],
|
||||||
},
|
page: 1,
|
||||||
onReachBottom() {
|
limit: 20,
|
||||||
!this.loading && this.hostProducts();
|
loadTitle: '',
|
||||||
}
|
loading: false,
|
||||||
};
|
loadend: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.hostProducts();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
routerGo(item) {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/shop/GoodsCon/index',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
hostProducts: function () {
|
||||||
|
let that = this;
|
||||||
|
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
||||||
|
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||||
|
that.loading = true;
|
||||||
|
getHostProducts(that.page, that.limit).then(res => {
|
||||||
|
that.loading = false;
|
||||||
|
//apply();js将一个数组插入另一个数组;
|
||||||
|
that.hostProduct.push.apply(that.hostProduct, res.data);
|
||||||
|
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
||||||
|
that.page = that.page + 1;
|
||||||
|
this.$emit('changeRecommendLoading', false)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name" : "yshopmall",
|
"name" : "yshopmall",
|
||||||
"appid" : "__UNI__C7A519E",
|
"appid" : "__UNI__C7A519E",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.1",
|
||||||
"versionCode" : 1,
|
"versionCode" : 1,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
|
|||||||
@@ -47,12 +47,12 @@
|
|||||||
cookie.set("spread", urlSpread);
|
cookie.set("spread", urlSpread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (this.$deviceType == "app" || this.$deviceType == "weixinh5") {
|
if (this.$deviceType == "app" || this.$deviceType == "weixinh5") {
|
||||||
// this.$yrouter.switchTab({
|
this.$yrouter.switchTab({
|
||||||
// path: "/pages/home/index"
|
path: "/pages/home/index"
|
||||||
// });
|
});
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
if (this.$store.getters.token) {
|
if (this.$store.getters.token) {
|
||||||
// 如果token存在,直接进行进页面
|
// 如果token存在,直接进行进页面
|
||||||
console.log('登录状态存在,直接进页面')
|
console.log('登录状态存在,直接进页面')
|
||||||
|
|||||||
@@ -41,46 +41,14 @@
|
|||||||
let item = this.detail[this.swiperCurrent];
|
let item = this.detail[this.swiperCurrent];
|
||||||
// 获取轮播图颜色
|
// 获取轮播图颜色
|
||||||
let bgcolor = item.bgcolor;
|
let bgcolor = item.bgcolor;
|
||||||
// #ifdef APP-PLUS
|
|
||||||
that.$set(item, 'bgcolor', '#c40414');
|
|
||||||
that.$emit('getbgcolor', '#c40414');
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
// 颜色不存在
|
// 颜色不存在
|
||||||
if (bgcolor === '') {
|
if (bgcolor === '') {
|
||||||
let ctx = uni.createCanvasContext('colorThief', that);
|
that.$set(item, 'bgcolor', '#c40414');
|
||||||
if (0 === that.webviewId || ctx.webviewId === that.webviewId) {
|
that.$emit('getbgcolor', '#c40414');
|
||||||
that.webviewId = ctx.webviewId;
|
|
||||||
uni.getImageInfo({
|
|
||||||
src: item.pic,
|
|
||||||
success: function (image) {
|
|
||||||
ctx.drawImage(image.path, 0, 0, image.width, image.height);
|
|
||||||
ctx.draw(true, function (e) {
|
|
||||||
uni.canvasGetImageData({
|
|
||||||
canvasId: 'colorThief',
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
width: parseInt(image.width),
|
|
||||||
height: parseInt(image.height),
|
|
||||||
success(res) {
|
|
||||||
let bgcolor = colorThief(res.data)
|
|
||||||
.color()
|
|
||||||
.getHex();
|
|
||||||
that.$set(item, 'bgcolor', bgcolor);
|
|
||||||
that.$emit('getbgcolor', bgcolor);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
that
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
that.$set(item, 'bgcolor', bgcolor);
|
that.$set(item, 'bgcolor', bgcolor);
|
||||||
that.$emit('getbgcolor', bgcolor);
|
that.$emit('getbgcolor', bgcolor);
|
||||||
}
|
}
|
||||||
// #endif
|
|
||||||
|
|
||||||
},
|
},
|
||||||
swiperChange(e) {
|
swiperChange(e) {
|
||||||
|
|||||||
@@ -308,6 +308,7 @@
|
|||||||
},
|
},
|
||||||
computed: mapGetters(["isLogin", "location"]),
|
computed: mapGetters(["isLogin", "location"]),
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
this.$store.commit("get_to", "goodcon");
|
||||||
let url = handleQrCode();
|
let url = handleQrCode();
|
||||||
if (!url) {
|
if (!url) {
|
||||||
url = handleUrlParam(getCurrentPageUrlWithArgs())
|
url = handleUrlParam(getCurrentPageUrlWithArgs())
|
||||||
|
|||||||
@@ -3,22 +3,14 @@
|
|||||||
<form @submit.prevent="submitForm">
|
<form @submit.prevent="submitForm">
|
||||||
<view class="search bg-color-red acea-row row-between-wrapper">
|
<view class="search bg-color-red acea-row row-between-wrapper">
|
||||||
<view class="input acea-row row-between-wrapper">
|
<view class="input acea-row row-between-wrapper">
|
||||||
<text class="iconfont icon-sousuo"></text>
|
|
||||||
<input placeholder="搜索商品信息" v-model="where.keyword" />
|
<input placeholder="搜索商品信息" v-model="where.keyword" />
|
||||||
|
<text class="iconfont icon-sousuo" @click="submitForm"></text>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="iconfont" :class="Switch === true ? 'icon-pailie' : 'icon-tupianpailie'" @click="switchTap"></view>
|
||||||
class="iconfont"
|
|
||||||
:class="Switch === true ? 'icon-pailie' : 'icon-tupianpailie'"
|
|
||||||
@click="switchTap"
|
|
||||||
></view>
|
|
||||||
</view>
|
</view>
|
||||||
</form>
|
</form>
|
||||||
<view class="nav acea-row row-middle">
|
<view class="nav acea-row row-middle">
|
||||||
<view
|
<view class="item" :class="title ? 'font-color-red' : ''" @click="set_where(0)">{{ title ? title : "默认" }}</view>
|
||||||
class="item"
|
|
||||||
:class="title ? 'font-color-red' : ''"
|
|
||||||
@click="set_where(0)"
|
|
||||||
>{{ title ? title : "默认" }}</view>
|
|
||||||
<view class="item" @click="set_where(1)">
|
<view class="item" @click="set_where(1)">
|
||||||
价格
|
价格
|
||||||
<image src="@/static/images/horn.png" v-if="price === 0" />
|
<image src="@/static/images/horn.png" v-if="price === 0" />
|
||||||
@@ -34,19 +26,9 @@
|
|||||||
<!-- down -->
|
<!-- down -->
|
||||||
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
|
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container">
|
||||||
class="list acea-row row-between-wrapper"
|
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'"
|
||||||
:class="Switch === true ? '' : 'on'"
|
v-for="(item, productListIndex) in productList" :key="productListIndex" :title="item.storeName">
|
||||||
ref="container"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
@click="goGoodsCon(item)"
|
|
||||||
class="item"
|
|
||||||
:class="Switch === true ? '' : 'on'"
|
|
||||||
v-for="(item, productListIndex) in productList"
|
|
||||||
:key="productListIndex"
|
|
||||||
:title="item.storeName"
|
|
||||||
>
|
|
||||||
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
||||||
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
||||||
</view>
|
</view>
|
||||||
@@ -64,209 +46,222 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<Loading :loaded="loadend" :loading="loading"></Loading>
|
<Loading :loaded="loadend" :loading="loading"></Loading>
|
||||||
<view
|
<view class="noCommodity" style="background-color: #fff;" v-if="productList.length === 0 && where.page > 1">
|
||||||
class="noCommodity"
|
|
||||||
style="background-color: #fff;"
|
|
||||||
v-if="productList.length === 0 && where.page > 1"
|
|
||||||
>
|
|
||||||
<view class="noPictrue">
|
<view class="noPictrue">
|
||||||
<image src="@/static/images/noGood.png" class="image" />
|
<image src="@/static/images/noGood.png" class="image" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<Recommend v-if="productList.length === 0 && where.page > 1"></Recommend>
|
<Recommend v-if="productList.length === 0 && where.page > 1" :recommendLoading="recommendLoading"
|
||||||
|
@changeRecommendLoading="changeRecommendLoading"></Recommend>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Recommend from "@/components/Recommend";
|
import Recommend from "@/components/Recommend";
|
||||||
import { getProducts } from "@/api/store";
|
import {
|
||||||
import Loading from "@/components/Loading";
|
getProducts
|
||||||
|
} from "@/api/store";
|
||||||
|
import Loading from "@/components/Loading";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "GoodsList",
|
name: "GoodsList",
|
||||||
components: {
|
components: {
|
||||||
Recommend,
|
Recommend,
|
||||||
Loading
|
Loading
|
||||||
},
|
},
|
||||||
props: {},
|
props: {},
|
||||||
data: function() {
|
data: function () {
|
||||||
// const { s = "", id = 0, title = "" } = this.$yroute.query;
|
// const { s = "", id = 0, title = "" } = this.$yroute.query;
|
||||||
const s = "",
|
const s = "",
|
||||||
id = 0,
|
id = 0,
|
||||||
title = "";
|
title = "";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hostProduct: [],
|
hostProduct: [],
|
||||||
productList: [],
|
productList: [],
|
||||||
Switch: true,
|
Switch: true,
|
||||||
where: {
|
where: {
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 8,
|
limit: 8,
|
||||||
keyword: s,
|
keyword: s,
|
||||||
sid: id, //二级分类id
|
sid: id, //二级分类id
|
||||||
news: 0,
|
news: 0,
|
||||||
priceOrder: "",
|
priceOrder: "",
|
||||||
salesOrder: ""
|
salesOrder: ""
|
||||||
|
},
|
||||||
|
title: title && id ? title : "",
|
||||||
|
loadTitle: "",
|
||||||
|
loading: false,
|
||||||
|
loadend: false,
|
||||||
|
price: 0,
|
||||||
|
stock: 0,
|
||||||
|
nows: false,
|
||||||
|
recommendLoading: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
title() {
|
||||||
|
this.updateTitle();
|
||||||
},
|
},
|
||||||
title: title && id ? title : "",
|
$yroute(to) {
|
||||||
loadTitle: "",
|
// if (to.name !== "GoodsList") return;
|
||||||
loading: false,
|
// const { s = "", id = 0, title = "" } = to.query;
|
||||||
loadend: false,
|
// if (s !== this.where.keyword || id !== this.where.sid) {
|
||||||
price: 0,
|
// this.where.keyword = s;
|
||||||
stock: 0,
|
// this.loadend = false;
|
||||||
nows: false
|
// this.loading = false;
|
||||||
};
|
// this.where.page = 1;
|
||||||
},
|
// this.where.sid = id;
|
||||||
watch: {
|
// this.title = title && id ? title : "";
|
||||||
title() {
|
// this.nows = false;
|
||||||
this.updateTitle();
|
// this.$set(this, "productList", []);
|
||||||
},
|
// this.price = 0;
|
||||||
$yroute(to) {
|
// this.stock = 0;
|
||||||
// if (to.name !== "GoodsList") return;
|
// this.get_product_list();
|
||||||
// const { s = "", id = 0, title = "" } = to.query;
|
// }
|
||||||
// if (s !== this.where.keyword || id !== this.where.sid) {
|
|
||||||
// this.where.keyword = s;
|
|
||||||
// this.loadend = false;
|
|
||||||
// this.loading = false;
|
|
||||||
// this.where.page = 1;
|
|
||||||
// this.where.sid = id;
|
|
||||||
// this.title = title && id ? title : "";
|
|
||||||
// this.nows = false;
|
|
||||||
// this.$set(this, "productList", []);
|
|
||||||
// this.price = 0;
|
|
||||||
// this.stock = 0;
|
|
||||||
// this.get_product_list();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted: function() {
|
|
||||||
const { s = "", id = 0, title = "" } = this.$yroute.query;
|
|
||||||
this.updateTitle();
|
|
||||||
this.get_product_list();
|
|
||||||
},
|
|
||||||
onReachBottom() {
|
|
||||||
!this.loading && this.get_product_list();
|
|
||||||
},
|
|
||||||
onHide() {
|
|
||||||
// this.hostProduct = [];
|
|
||||||
// this.productList = [];
|
|
||||||
// this.Switch = true;
|
|
||||||
// this.where = {
|
|
||||||
// page: 1,
|
|
||||||
// limit: 8,
|
|
||||||
// keyword: s,
|
|
||||||
// sid: id, //二级分类id
|
|
||||||
// news: 0,
|
|
||||||
// priceOrder: "",
|
|
||||||
// salesOrder: ""
|
|
||||||
// };
|
|
||||||
// this.loadTitle = "";
|
|
||||||
// this.loading = false;
|
|
||||||
// this.loadend = false;
|
|
||||||
// this.price = 0;
|
|
||||||
// this.stock = 0;
|
|
||||||
// this.nows = fals;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
goGoodsCon(item) {
|
|
||||||
this.$yrouter.push({
|
|
||||||
path: "/pages/shop/GoodsCon/index",
|
|
||||||
query: { id: item.id }
|
|
||||||
});
|
|
||||||
},
|
|
||||||
updateTitle() {
|
|
||||||
// document.title = this.title || this.$yroute.meta.title;
|
|
||||||
},
|
|
||||||
get_product_list() {
|
|
||||||
var that = this;
|
|
||||||
this.setWhere();
|
|
||||||
// if (to.name !== "GoodsList") return;
|
|
||||||
const { s = "", id = 0, title = "" } = this.$yroute.query;
|
|
||||||
if (s !== this.where.keyword || id !== this.where.sid) {
|
|
||||||
this.where.keyword = s;
|
|
||||||
this.loadend = false;
|
|
||||||
this.loading = false;
|
|
||||||
this.where.page = 1;
|
|
||||||
this.where.sid = id;
|
|
||||||
this.title = title && id ? title : "";
|
|
||||||
this.nows = false;
|
|
||||||
this.$set(this, "productList", []);
|
|
||||||
this.price = 0;
|
|
||||||
this.stock = 0;
|
|
||||||
// this.get_product_list();
|
|
||||||
}
|
}
|
||||||
let q = that.where;
|
|
||||||
getProducts(q).then(res => {
|
|
||||||
that.loading = false;
|
|
||||||
that.productList.push.apply(that.productList, res.data);
|
|
||||||
that.loadend = res.data.length < that.where.limit; //判断所有数据是否加载完成;
|
|
||||||
that.where.page = that.where.page + 1;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
submitForm: function() {
|
mounted: function () {
|
||||||
this.$set(this, "productList", []);
|
const {
|
||||||
this.where.page = 1;
|
s = "", id = 0, title = ""
|
||||||
this.loadend = false;
|
} = this.$yroute.query;
|
||||||
this.loading = false;
|
this.where.keyword = s;
|
||||||
|
|
||||||
|
this.updateTitle();
|
||||||
this.get_product_list();
|
this.get_product_list();
|
||||||
},
|
},
|
||||||
//点击事件处理
|
onReachBottom() {
|
||||||
set_where: function(index) {
|
this.recommendLoading = true;
|
||||||
let that = this;
|
!this.loading && this.get_product_list();
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
return that.$yrouter.push({ path: "/pages/shop/GoodsClass/index" });
|
|
||||||
case 1:
|
|
||||||
if (that.price === 0) that.price = 1;
|
|
||||||
else if (that.price === 1) that.price = 2;
|
|
||||||
else if (that.price === 2) that.price = 0;
|
|
||||||
that.stock = 0;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if (that.stock === 0) that.stock = 1;
|
|
||||||
else if (that.stock === 1) that.stock = 2;
|
|
||||||
else if (that.stock === 2) that.stock = 0;
|
|
||||||
that.price = 0;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
that.nows = !that.nows;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
that.$set(that, "productList", []);
|
|
||||||
that.where.page = 1;
|
|
||||||
that.loadend = false;
|
|
||||||
that.get_product_list();
|
|
||||||
},
|
},
|
||||||
//设置where条件
|
onHide() {
|
||||||
setWhere: function() {
|
// this.hostProduct = [];
|
||||||
let that = this;
|
// this.productList = [];
|
||||||
if (that.price === 0) {
|
// this.Switch = true;
|
||||||
that.where.priceOrder = "";
|
// this.where = {
|
||||||
} else if (that.price === 1) {
|
// page: 1,
|
||||||
that.where.priceOrder = "asc";
|
// limit: 8,
|
||||||
} else if (that.price === 2) {
|
// keyword: s,
|
||||||
that.where.priceOrder = "desc";
|
// sid: id, //二级分类id
|
||||||
}
|
// news: 0,
|
||||||
if (that.stock === 0) {
|
// priceOrder: "",
|
||||||
that.where.salesOrder = "";
|
// salesOrder: ""
|
||||||
} else if (that.stock === 1) {
|
// };
|
||||||
that.where.salesOrder = "asc";
|
// this.loadTitle = "";
|
||||||
} else if (that.stock === 2) {
|
// this.loading = false;
|
||||||
that.where.salesOrder = "desc";
|
// this.loadend = false;
|
||||||
}
|
// this.price = 0;
|
||||||
that.where.news = that.nows ? "1" : "0";
|
// this.stock = 0;
|
||||||
|
// this.nows = fals;
|
||||||
},
|
},
|
||||||
switchTap: function() {
|
methods: {
|
||||||
let that = this;
|
changeRecommendLoading(recommendLoading) {
|
||||||
that.Switch = !that.Switch;
|
this.recommendLoading = recommendLoading
|
||||||
|
},
|
||||||
|
goGoodsCon(item) {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: "/pages/shop/GoodsCon/index",
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
updateTitle() {
|
||||||
|
// document.title = this.title || this.$yroute.meta.title;
|
||||||
|
},
|
||||||
|
get_product_list() {
|
||||||
|
var that = this;
|
||||||
|
this.setWhere();
|
||||||
|
// if (to.name !== "GoodsList") return;
|
||||||
|
const {
|
||||||
|
s = "", id = 0, title = ""
|
||||||
|
} = this.$yroute.query;
|
||||||
|
if (s !== this.where.keyword || id !== this.where.sid) {
|
||||||
|
this.loadend = false;
|
||||||
|
this.loading = false;
|
||||||
|
this.where.page = 1;
|
||||||
|
this.where.sid = id;
|
||||||
|
this.title = title && id ? title : "";
|
||||||
|
this.nows = false;
|
||||||
|
this.$set(this, "productList", []);
|
||||||
|
this.price = 0;
|
||||||
|
this.stock = 0;
|
||||||
|
// this.get_product_list();
|
||||||
|
}
|
||||||
|
let q = that.where;
|
||||||
|
getProducts(q).then(res => {
|
||||||
|
that.loading = false;
|
||||||
|
that.productList.push.apply(that.productList, res.data);
|
||||||
|
that.loadend = res.data.length < that.where.limit; //判断所有数据是否加载完成;
|
||||||
|
that.where.page = that.where.page + 1;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submitForm: function () {
|
||||||
|
this.$set(this, "productList", []);
|
||||||
|
this.where.page = 1;
|
||||||
|
this.loadend = false;
|
||||||
|
this.loading = false;
|
||||||
|
this.get_product_list();
|
||||||
|
},
|
||||||
|
//点击事件处理
|
||||||
|
set_where: function (index) {
|
||||||
|
let that = this;
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
return that.$yrouter.push({
|
||||||
|
path: "/pages/shop/GoodsClass/index"
|
||||||
|
});
|
||||||
|
case 1:
|
||||||
|
if (that.price === 0) that.price = 1;
|
||||||
|
else if (that.price === 1) that.price = 2;
|
||||||
|
else if (that.price === 2) that.price = 0;
|
||||||
|
that.stock = 0;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (that.stock === 0) that.stock = 1;
|
||||||
|
else if (that.stock === 1) that.stock = 2;
|
||||||
|
else if (that.stock === 2) that.stock = 0;
|
||||||
|
that.price = 0;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
that.nows = !that.nows;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
that.$set(that, "productList", []);
|
||||||
|
that.where.page = 1;
|
||||||
|
that.loadend = false;
|
||||||
|
that.get_product_list();
|
||||||
|
},
|
||||||
|
//设置where条件
|
||||||
|
setWhere: function () {
|
||||||
|
let that = this;
|
||||||
|
if (that.price === 0) {
|
||||||
|
that.where.priceOrder = "";
|
||||||
|
} else if (that.price === 1) {
|
||||||
|
that.where.priceOrder = "asc";
|
||||||
|
} else if (that.price === 2) {
|
||||||
|
that.where.priceOrder = "desc";
|
||||||
|
}
|
||||||
|
if (that.stock === 0) {
|
||||||
|
that.where.salesOrder = "";
|
||||||
|
} else if (that.stock === 1) {
|
||||||
|
that.where.salesOrder = "asc";
|
||||||
|
} else if (that.stock === 2) {
|
||||||
|
that.where.salesOrder = "desc";
|
||||||
|
}
|
||||||
|
that.where.news = that.nows ? "1" : "0";
|
||||||
|
},
|
||||||
|
switchTap: function () {
|
||||||
|
let that = this;
|
||||||
|
that.Switch = !that.Switch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.noCommodity {
|
.noCommodity {
|
||||||
border-top: 3px solid #f5f5f5;
|
border-top: 3px solid #f5f5f5;
|
||||||
padding-bottom: 1px;
|
padding-bottom: 1px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__C7A519E","name":"yshopmall","version":{"name":"1.0.0","code":1},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueCompiler":"uni-app","compilerVersion":3,"allowsInlineMediaPlayback":true,"safearea":{"background":"#ffffff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"2.6.8","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#282828","selectedColor":"#00c17b","borderStyle":"rgba(0,0,0,0.4)","backgroundColor":"#ffffff","height":"50px","fontSize":"10px","iconWidth":"24px","spacing":"3px","list":[{"pagePath":"pages/home/index","iconPath":"static/icon-home.png","selectedIconPath":"static/icon-home-hot.png","text":"首页"},{"pagePath":"pages/shop/GoodsClass/index","iconPath":"static/icon-class.png","selectedIconPath":"static/icon-class-hot.png","text":"分类"},{"pagePath":"pages/shop/ShoppingCart/index","iconPath":"static/icon-cart.png","selectedIconPath":"static/icon-cart-hot.png","text":"购物车"},{"pagePath":"pages/user/User/index","iconPath":"static/icon-user.png","selectedIconPath":"static/icon-user-hot.png","text":"我的"}]},"launch_path":"__uniappview.html"}}
|
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__C7A519E","name":"yshopmall","version":{"name":"1.0.0","code":1},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":false,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueCompiler":"uni-app","compilerVersion":3,"allowsInlineMediaPlayback":true,"safearea":{"background":"#ffffff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"2.8.3","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#282828","selectedColor":"#eb3729","borderStyle":"rgba(0,0,0,0.4)","backgroundColor":"#ffffff","height":"50px","fontSize":"10px","iconWidth":"24px","spacing":"3px","list":[{"pagePath":"pages/home/index","iconPath":"static/icon-home.png","selectedIconPath":"static/icon-home-hot.png","text":"首页"},{"pagePath":"pages/shop/GoodsClass/index","iconPath":"static/icon-class.png","selectedIconPath":"static/icon-class-hot.png","text":"分类"},{"pagePath":"pages/shop/ShoppingCart/index","iconPath":"static/icon-cart.png","selectedIconPath":"static/icon-cart-hot.png","text":"购物车"},{"pagePath":"pages/user/User/index","iconPath":"static/icon-user.png","selectedIconPath":"static/icon-user-hot.png","text":"我的"}]},"launch_path":"__uniappview.html"}}
|
||||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 8.2 KiB |
@@ -988,7 +988,7 @@ export function chooseImage(callback) {
|
|||||||
console.log(image);
|
console.log(image);
|
||||||
uni.showLoading({ title: "图片上传中", mask: true });
|
uni.showLoading({ title: "图片上传中", mask: true });
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: `${VUE_APP_API_URL} /api/upload`,
|
url: `${VUE_APP_API_URL}/api/upload`,
|
||||||
file: image,
|
file: image,
|
||||||
filePath: image.path,
|
filePath: image.path,
|
||||||
header: {
|
header: {
|
||||||
|
|||||||