瀑布流与短连接

main
syt 7 months ago
parent e877b1f291
commit d6c60d2738
  1. 4
      api/goods/index.js
  2. 2
      config.js
  3. 39
      pages/goods/detail.vue
  4. 7
      pages/goods/list.vue
  5. 2
      pages/news/rules/index.vue
  6. 8
      uni_modules/vk-uview-ui/components/u-waterfall/u-waterfall.vue

@ -14,6 +14,10 @@ const api = {
presale:'goods/presale' presale:'goods/presale'
} }
// 短连接
export const goodsShortUrl = (param, option) => {
return request.post('goods/shortUrl', param, option)
}
// 商品价格修改 // 商品价格修改
export const editGoodsPrice = (param, option) => { export const editGoodsPrice = (param, option) => {
return request.post('StoreKeeper/editGoodsPrice', param, option) return request.post('StoreKeeper/editGoodsPrice', param, option)

@ -15,7 +15,7 @@ export default {
* 可在超管后台-商城列表中查看10025 * 可在超管后台-商城列表中查看10025
*/ */
storeId: wx.getExtConfigSync().store_id? wx.getExtConfigSync().store_id : 10048, storeId: wx.getExtConfigSync().store_id? wx.getExtConfigSync().store_id : 10045,
// storeId: 10037, // storeId: 10037,

@ -465,6 +465,7 @@
}, },
data() { data() {
return { return {
options: {},
timestamp: new Date().getTime(), timestamp: new Date().getTime(),
goods_sku_no: "", goods_sku_no: "",
isTodo: false, isTodo: false,
@ -529,6 +530,7 @@
}, },
onLoad(options) { onLoad(options) {
const that = this; const that = this;
that.options = options;
let result = uni.getStorageSync("addressResult") let result = uni.getStorageSync("addressResult")
this.addressResult = result ? result.address_component : this.addressResult this.addressResult = result ? result.address_component : this.addressResult
this.isPre = options.isPre ? options.isPre : null this.isPre = options.isPre ? options.isPre : null
@ -1100,10 +1102,18 @@
this.isTodo = true; this.isTodo = true;
this.openDialog = false; this.openDialog = false;
}, },
toHaibao(index) { //
this.shareCancel(); async toQueryShortUrl() {
if (index == 2) { //
let str = `型号:${this.goods.goods_name}\n前台价:¥${this.goods.goods_price_max}\n推广价:¥${this.goods.goods_price_min}\nSKU:${this.goods.goods_no}\n京东链接:https://item.jd.com/${this.goods.goods_no}.html` const that = this;
//
const params = that.$getShareUrlParams(this.options)
const res = await GoodsApi.goodsShortUrl({
page_url: `pages/goods/detail?${params}`,
page_title: that.goods.goods_name
})
if(res.data.url){
let str = `型号:${that.goods.goods_name}\n前台价:¥${that.goods.goods_price_max}\n推广价:¥${that.goods.goods_price_min}\nSKU:${that.goods.goods_no}\n小程序链接:${res.data.url}`
uni.setClipboardData({ uni.setClipboardData({
data: str, // value data: str, // value
success: function() { success: function() {
@ -1115,6 +1125,20 @@
}) })
} }
}) })
}else{
uni.showToast({
title: '复制失败',
icon: 'none',
duration: 2000
})
}
},
toHaibao(index) {
this.shareCancel();
if (index == 2) {
this.toQueryShortUrl();
} else { } else {
this.openDialog = false this.openDialog = false
this.showGoodsPosterPopup = true; this.showGoodsPosterPopup = true;
@ -1127,9 +1151,7 @@
onShareAppMessage() { onShareAppMessage() {
const app = this const app = this
// //
const params = app.$getShareUrlParams({ const params = app.$getShareUrlParams(this.options)
goodsId: app.goodsId,
})
return { return {
title: app.goods.goods_name, title: app.goods.goods_name,
imageUrl: app.goods.goods_image, imageUrl: app.goods.goods_image,
@ -1144,10 +1166,11 @@
*/ */
onShareTimeline() { onShareTimeline() {
const app = this const app = this
const params = app.$getShareUrlParams(this.options)
return { return {
title: app.goods.goods_name, title: app.goods.goods_name,
imageUrl: app.goods.goods_image, imageUrl: app.goods.goods_image,
path: `/pages/goods/detail?goodsId=${app.goodsId}` path: `/pages/goods/detail?${params}`
} }
} }
} }

@ -114,6 +114,7 @@
<!-- 商品图片 --> <!-- 商品图片 -->
<view class="goods-image"> <view class="goods-image">
<image class="image" mode="aspectFill" :src="item.goods_image"></image> <image class="image" mode="aspectFill" :src="item.goods_image"></image>
<!-- <u-lazy-load threshold="0" border-radius="10" image-mode="aspectFill" :loading-img="item.goods_image" :image="item.goods_image" :index="index"></u-lazy-load> -->
</view> </view>
<view class="detail" style="padding-top: 10rpx;"> <view class="detail" style="padding-top: 10rpx;">
<!-- 商品名称 --> <!-- 商品名称 -->
@ -169,6 +170,7 @@
<!-- 商品图片 --> <!-- 商品图片 -->
<view class="goods-image"> <view class="goods-image">
<image class="image" mode="aspectFill" :src="item.goods_image"></image> <image class="image" mode="aspectFill" :src="item.goods_image"></image>
<!-- <u-lazy-load threshold="0" border-radius="10" image-mode="aspectFill" :loading-img="item.goods_image" :image="item.goods_image" :index="index"></u-lazy-load> -->
</view> </view>
<view class="detail" style="padding-top: 10rpx;"> <view class="detail" style="padding-top: 10rpx;">
<!-- 商品名称 --> <!-- 商品名称 -->
@ -236,7 +238,7 @@
} from '@/core/app' } from '@/core/app'
import Search from '@/components/search' import Search from '@/components/search'
const pageSize = 15 const pageSize = 10
const showViewKey = 'GoodsList-ShowView'; const showViewKey = 'GoodsList-ShowView';
import * as cstegory from '@/api/category' import * as cstegory from '@/api/category'
export default { export default {
@ -443,7 +445,8 @@
const newList = result.data.list const newList = result.data.list
console.log(newList) console.log(newList)
let arr = getMoreListData(newList, app.list, pageNo); let arr = getMoreListData(newList, app.list, pageNo);
app.list.data = app.arrayUnique(arr, 'goods_id') // app.list.data = app.arrayUnique(arr, 'goods_id')
app.list.data = arr;
app.total = result.data.list.total; app.total = result.data.list.total;
console.log(newList) console.log(newList)
resolve(newList) resolve(newList)

@ -20,7 +20,7 @@
onLoad(options){ onLoad(options){
this.itemInfo = JSON.parse(decodeURIComponent(options.itemInfo)) this.itemInfo = JSON.parse(decodeURIComponent(options.itemInfo))
this.title = this.itemInfo.title; this.title = this.itemInfo.title;
this.strings = this.itemInfo.content.replace(/style=\"text-wrap: nowrap;\"/g,'style=\"text-wrap: inherit;\"');; this.strings = this.itemInfo.content.replace(/style=\"text-wrap: nowrap;\"/g,'style=\"text-wrap: inherit;\"');
}, },
methods:{ methods:{

@ -38,13 +38,13 @@ export default {
// ms // ms
addTime: { addTime: {
type: [Number, String], type: [Number, String],
default: 200 default: 300
}, },
// ididKey{idx: 22, name: 'lisa'} // ididKey{idx: 22, name: 'lisa'}
// idKeyidx // idKeyidx
idKey: { idKey: {
type: String, type: String,
default: "id" default: "goods_id"
} }
}, },
data() { data() {
@ -105,7 +105,9 @@ export default {
} else { } else {
this.rightList.push(item); this.rightList.push(item);
} }
} }
// console.log("this.leftList",this.leftList)
// console.log("this.rightList",this.rightList)
// //
this.tempList.splice(0, 1); this.tempList.splice(0, 1);
// //

Loading…
Cancel
Save