Commit 0667be6b by huahua

提交

parent 9cdf6526
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
<view :style="{width: data.bgWidth +'px',height: data.bgHeight +'px' }" style="position: relative; "> <view :style="{width: data.bgWidth +'px',height: data.bgHeight +'px' }" style="position: relative; ">
<!-- background: #ffaa00; --> <!-- background: #ffaa00; -->
<!-- 底图 --> <!-- 底图 -->
<!-- <image :src="data.bgImage_old" mode="widthFix" <!-- <image :src="data.bgImage_old" mode="widthFix"
:style="{width: data.bgWidth +'px',height: data.bgWidth +'px' }" :style="{width: data.bgWidth +'px',height: data.bgWidth +'px' }"
style="position: absolute; z-index: 0; top: 0; bottom: 0; margin: auto;"></image> --> style="position: absolute; z-index: 0; top: 0; bottom: 0; margin: auto;"></image> -->
...@@ -316,10 +315,12 @@ ...@@ -316,10 +315,12 @@
<!-- 菜单栏目 --> <!-- 菜单栏目 -->
<view v-if="!active && !guide_left" class="toolRight"> <view v-if="!active && !guide_left" class="toolRight">
<view class="tool_li"> <view class="tool_li">
<view class="tool_li" @click="showPopup(99)"> <view class="tool_li" @click="showPopup(99)">
<image class="tool_li_img" src="../../static/icon_diy_shoucang.png" mode=""></image> <image class="tool_li_img" src="../../static/img/icon_history_image.png" mode=""></image>
<view class="tool_li_text">我的收藏</view> <view class="tool_li_text">历史作品</view>
</view> </view>
<view class="tool_li" @click="showPopup(23)"> <view class="tool_li" @click="showPopup(23)">
<image class="tool_li_img" src="../../static/icon_diy_wallpaper.png" mode=""></image> <image class="tool_li_img" src="../../static/icon_diy_wallpaper.png" mode=""></image>
<view class="tool_li_text">全幅壁纸</view> <view class="tool_li_text">全幅壁纸</view>
...@@ -333,35 +334,37 @@ ...@@ -333,35 +334,37 @@
<image class="tool_li_img" src="../../static/icon_make_diy_uplaod_image.png" mode=""></image> <image class="tool_li_img" src="../../static/icon_make_diy_uplaod_image.png" mode=""></image>
<view class="tool_li_text">背景底色</view> <view class="tool_li_text">背景底色</view>
</view> </view>
<!-- <view class="tool_li" @click="showPopup(28)">
<image class="tool_li_img" src="../../static/icon_make_diy_uplaod_image.png" mode=""></image>
<view class="tool_li_text">背景底色</view>
</view> -->
<view class="tool_li" @click="showone = !showone"> <view class="tool_li" @click="showone = !showone">
<image @click="cancel('share')" class="tool_li_img" <image @click="cancel('share')" class="tool_li_img"
src="../../static/icon_make_diy_back_color.png" mode=""></image> src="../../static/icon_make_diy_back_color.png" mode=""></image>
<view @click="cancel()" class="tool_li_text">上传相片</view> <view @click="cancel()" class="tool_li_text">上传相片</view>
</view> </view>
<view class="tool_li" @click="showPopup(3)"> <view class="tool_li" @click="showPopup(3)">
<image class="tool_li_img" src="../../static/icon_diy_typeface.png" <image class="tool_li_img" src="../../static/icon_diy_typeface.png"
style="width: 45upx; height: 40upx;" mode=""></image> style="width: 45upx; height: 40upx;" mode=""></image>
<view @click="cancel()" class="tool_li_text">添加文字</view> <view @click="cancel()" class="tool_li_text">添加文字</view>
</view> </view>
<view class="tool_li" @click="ontuya()" v-if="machine_id"> <view class="tool_li" @click="ontuya()" v-if="machine_id">
<image class="tool_li_img" style="width: 62upx; height: 55upx;" src="../../static/icon_tuya.png" <image class="tool_li_img" style="width: 62upx; height: 55upx;" src="../../static/icon_tuya.png"
mode=""></image> mode=""></image>
<view class="tool_li_text">添加涂鸦</view> <view class="tool_li_text">添加涂鸦</view>
</view> </view>
<view class="tool_li" @click="wallpaperOnclick()" v-if="machine_id"> <view class="tool_li" @click="wallpaperOnclick()" v-if="machine_id">
<image class="tool_li_img" style="width: 71upx; height: 59upx;" <image class="tool_li_img" style="width: 71upx; height: 59upx;"
src="../../static/randomwallpaper.png" mode=""></image> src="../../static/randomwallpaper.png" mode=""></image>
<view class="tool_li_text">智能推荐</view> <view class="tool_li_text">智能推荐</view>
</view> </view>
<view class="tool_li" @click.stop="removedeleteItem" v-if="data.itemList.length > 0"> <view class="tool_li" @click.stop="removedeleteItem" v-if="data.itemList.length > 0">
<image class="tool_li_img" style="width: 50upx; height: 50upx;" <image class="tool_li_img" style="width: 50upx; height: 50upx;"
src="../../static/diy_icon_middle_default.png" mode=""></image> src="../../static/diy_icon_middle_default.png" mode=""></image>
<view class="tool_li_text">移除图片</view> <view class="tool_li_text">移除图片</view>
</view> </view>
<view class="tool_li" style="height: 70upx;" v-if="background_color" <view class="tool_li" style="height: 70upx;" v-if="background_color"
@click.stop="background_color = null"> @click.stop="background_color = null">
<image class="tool_li_img" style="width: 51upx; height: 51upx;" <image class="tool_li_img" style="width: 51upx; height: 51upx;"
...@@ -376,18 +379,6 @@ ...@@ -376,18 +379,6 @@
align-items: center;" @click="oclikGifImage()" @touchstart="oclikGifImage()"> align-items: center;" @click="oclikGifImage()" @touchstart="oclikGifImage()">
</image> </image>
<!-- <view style="height: 200upx;"></view>
<view class="tool_li" v-if="background_color" @click.stop="background_color = null">
<image class="tool_li_img" style="width: 50upx; height: 50upx;"
src="../../static/diy_icon_replace_default.png" mode=""></image>
</view>
<view class="tool_li" @click.stop="removedeleteItem" v-if="data.itemList.length > 0">
<image class="tool_li_img" style="width: 50upx; height: 50upx;"
src="../../static/diy_icon_middle_default.png" mode=""></image>
</view> -->
<!-- <view class="tool_li" @click="showPopup(30)">
<image class="tool_li_img" src="../../static/color.png" mode=""></image>
</view> -->
</view> </view>
</view> </view>
...@@ -419,21 +410,13 @@ ...@@ -419,21 +410,13 @@
<view @click.stop="createWorks" hover-class="hover-class-bg" <view @click.stop="createWorks" hover-class="hover-class-bg"
:class="['tool_add',!machine_id ? 'grey' : '']">立即下单</view> :class="['tool_add',!machine_id ? 'grey' : '']">立即下单</view>
</view> </view>
<!-- 单指可拖拽 --> <!-- 单指可拖拽 -->
<!-- && data.itemList.length > 0 -->
<view v-if="!guide_left " <view v-if="!guide_left "
style="position: fixed; font-size: 22upx; color: #999999; bottom: 280upx;left: 50%;transform: translate(-50%, 0%);z-index: 999; "> style="position: fixed; font-size: 22upx; color: #999999; bottom: 280upx;left: 50%;transform: translate(-50%, 0%);z-index: 999; ">
<view>单指拖拽,双指伸缩</view> <view>单指拖拽,双指伸缩</view>
<!-- <view>双指可缩放</view>
<view>双击可裁剪</view> -->
</view> </view>
<!-- <view style="text-align: center; color: #FFFFFF; position: fixed; z-index: 99;
left: 0; right: 0; bottom: 227upx;">
<view>打印时,自动生成 4 x 3 排版</view>
<text style="color: #0CA457; padding: 20upx;" @click="drawImg">预览></text>
</view> -->
<!-- 预览 --> <!-- 预览 -->
<view v-if="showtwo"> <view v-if="showtwo">
<view <view
...@@ -1340,7 +1323,6 @@ ...@@ -1340,7 +1323,6 @@
}, },
//选择微信相片跟本地相册弹框取消 //选择微信相片跟本地相册弹框取消
selectPicturePopColse() { selectPicturePopColse() {
//console.log("取消进来")
//this.delete_wrap_state = false //this.delete_wrap_state = false
this.showone = false this.showone = false
this.$refs['showpicture'].close(); this.$refs['showpicture'].close();
...@@ -1385,8 +1367,6 @@ ...@@ -1385,8 +1367,6 @@
'callback': atter.callback, 'callback': atter.callback,
}, },
success: function(res) { success: function(res) {
//console.log(res);
//console.log("上传图片"+successUp+"res.statusCode="+res.statusCode)
successUp++; successUp++;
if (res.statusCode != 200) { if (res.statusCode != 200) {
// console.log({errCode: '599', msg:'其他错误'}) // console.log({errCode: '599', msg:'其他错误'})
...@@ -1412,12 +1392,22 @@ ...@@ -1412,12 +1392,22 @@
let ratioheight = (_this.data let ratioheight = (_this.data
.editorHeight * _this.mix_scale) / .editorHeight * _this.mix_scale) /
image.height image.height
// console.log(_this.mix_scale)
// if (ratio >= 1) { //长方形
width = _this.data.editorWidth * _this width = _this.data.editorWidth * _this
.mix_scale .mix_scale
height = image.height * ratiowidth height = image.height * ratiowidth
// if (height / 2 > _this.editor_top) { // if (height / 2 > _this.editor_top) {
// width = width * (_this.editor_top * 2 /
// height)
// height = _this.editor_top * 2
// }
// console.log(_this.mix_scale)
// if (ratio >= 1) { //长方形
//width = _this.data.editorWidth * _this.mix_scale
//height = image.height * ratiowidth
// if (height / 2 > _this.editor_top) {
// width = width * (_this.editor_top * 2 / height) // width = width * (_this.editor_top * 2 / height)
// height = _this.editor_top * 2 // height = _this.editor_top * 2
// } // }
...@@ -1925,7 +1915,6 @@ ...@@ -1925,7 +1915,6 @@
//''console.log("进来壁纸") //''console.log("进来壁纸")
that.Worksdetaildata(item) that.Worksdetaildata(item)
} else if (this.e_active == 22) { //特效 } else if (this.e_active == 22) { //特效
// console.log(item)
this.shape_image = item.image this.shape_image = item.image
this.shape_id = item.id this.shape_id = item.id
this.shape_price = item.sales_price this.shape_price = item.sales_price
...@@ -1939,12 +1928,15 @@ ...@@ -1939,12 +1928,15 @@
}, },
Worksdetaildata(item) { //this.e_active 1模板 2贴图 3字体 4编辑 22添加相框 Worksdetaildata(item) { //this.e_active 1模板 2贴图 3字体 4编辑 22添加相框
let s_data = 'Works' let s_data = 'Works'
let isWork = item.isWork;
if (this.e_active == 1) { if (this.e_active == 1) {
items = [] items = []
} else if (this.e_active == 2 || this.e_active == 23) { } else if (this.e_active == 2 || this.e_active == 23 || this.e_active == 99) {
s_data = 'Material' if (isWork) {
} else if (this.e_active == 99) { s_data = 'Works'
s_data = 'Material' } else {
s_data = 'Material'
}
} }
uni.showLoading({ uni.showLoading({
title: '正在加载中...', title: '正在加载中...',
...@@ -2030,9 +2022,30 @@ ...@@ -2030,9 +2022,30 @@
title: '加载中...', title: '加载中...',
mask: true mask: true
}) })
let support_zoom = 1; // 0是不支持缩放,为1时支持缩放
let support_drag = 1; // 0是不支持拖动,为1时支持拖动
let is_under = 0; //贴图是否为背景图
let is_discount = 0; //贴图是否用卷
let urlData;
let material_id = 0; //贴图id
let original_id = 0;
if (isWork) {
urlData = result.image
result.mix_scale = 1;
result.is_under = 0;
} else {
urlData = result.url
support_zoom = result.support_zoom; // 0是不支持缩放,为1时支持缩放
support_drag = result.support_drag; // 0是不支持拖动,为1时支持拖动
is_under = result.is_under; //贴图是否为背景图
is_discount = result.is_discount; //贴图是否用卷
}
// 读取主图遮罩 // 读取主图遮罩
uni.getImageInfo({ uni.getImageInfo({
src: result.url, src: urlData,
success: (image) => { success: (image) => {
if (this.e_active == 23) { if (this.e_active == 23) {
...@@ -2054,13 +2067,13 @@ ...@@ -2054,13 +2067,13 @@
let ratioheight = (this.data.editorHeight * this.mix_scale) / image let ratioheight = (this.data.editorHeight * this.mix_scale) / image
.height .height
let resultmix_scale = result.mix_scale || 1 let resultmix_scale = result.mix_scale || 1
if (ratio >= 1) { //长方形 // if (ratio >= 1) { //长方形
width = this.data.editorWidth * this.mix_scale * resultmix_scale width = this.data.editorWidth * this.mix_scale * resultmix_scale
height = image.height * ratiowidth * resultmix_scale height = image.height * ratiowidth * resultmix_scale
} else if (ratio < 1) { //长高方形 // } else if (ratio < 1) { //长高方形
height = this.data.editorHeight * this.mix_scale * resultmix_scale // height = this.data.editorHeight * this.mix_scale * resultmix_scale
width = image.width * ratioheight * resultmix_scale // width = image.width * ratioheight * resultmix_scale
} // }
if (result.is_under == 1) { if (result.is_under == 1) {
let number_index = 0 let number_index = 0
for (var item of items) { for (var item of items) {
...@@ -2073,31 +2086,27 @@ ...@@ -2073,31 +2086,27 @@
index = number_index index = number_index
} }
//this.isShowGif = true;
items.push({ items.push({
support_zoom: result.support_zoom, // 0是不支持缩放,为1时支持缩放 support_zoom: support_zoom, // 0是不支持缩放,为1时支持缩放
support_drag: result.support_drag, // 0是不支持拖动,为1时支持拖动 support_drag: support_drag, // 0是不支持拖动,为1时支持拖动
is_under: result.is_under, //贴图是否为背景图 is_under: is_under, //贴图是否为背景图
is_discount: result.is_discount, //贴图是否用卷 is_discount: is_discount, //贴图是否用卷
id: items.length + 1, id: items.length + 1,
type: 2, //0图片 1文字 2贴图 type: 2, //0图片 1文字 2贴图
material_id: result.id, //贴图id material_id: material_id, //贴图id
original_id: result.id, original_id: original_id,
index: index, index: index,
font_family: '', font_family: '',
font_style: '', font_style: '',
font_size: '', font_size: '',
font_color: '', font_color: '',
under_color: '', under_color: '',
content: result.url, // 贴图地址 content: urlData, // 贴图地址
top: this.editor_top - height / 2, // 初始图片Y坐标,根据画布高/2-图片高/2 top: this.editor_top - height / 2, // 初始图片Y坐标,根据画布高/2-图片高/2
// top: this.data.editorHeight / 2 - height / 2, // 初始图片Y坐标,根据画布高/2-图片高/2
left: this.data.editorWidth / 2 - width / left: this.data.editorWidth / 2 - width /
2, // 初始图片X坐标,因为div是相对定位,所以计算是要多减一次移动的距离 2, // 初始图片X坐标,因为div是相对定位,所以计算是要多减一次移动的距离
x: this.data.editorWidth / x: this.data.editorWidth /
2, // 初始圆心位置,可再downImg之后又宽高和初始的图片位置得出 2, // 初始圆心位置,可再downImg之后又宽高和初始的图片位置得出
// y: this.data.editorHeight / 2,
y: this.editor_top, y: this.editor_top,
scale: 1, // 缩放比例 1为不缩放 scale: 1, // 缩放比例 1为不缩放
lastScale: 1, // 上一次的绽放比例 lastScale: 1, // 上一次的绽放比例
...@@ -2112,7 +2121,6 @@ ...@@ -2112,7 +2121,6 @@
activescale: false, // 开启旋转状态 activescale: false, // 开启旋转状态
activehorn: false, // 开启角状态 activehorn: false, // 开启角状态
activeedge: false, // 开启边状态 activeedge: false, // 开启边状态
// 分界线
initialScale: 1, // 图片缩放比例 initialScale: 1, // 图片缩放比例
initialscaling: 1, // 图片初始时缩放比例 initialscaling: 1, // 图片初始时缩放比例
initialScalex: 1, // 图片宽缩放比例 initialScalex: 1, // 图片宽缩放比例
...@@ -2124,6 +2132,7 @@ ...@@ -2124,6 +2132,7 @@
frame_top: null, // 裁剪窗口y frame_top: null, // 裁剪窗口y
image_top: null, // 图片y image_top: null, // 图片y
}) })
// 提示用户此贴图可用卷 // 提示用户此贴图可用卷
if (result.is_discount == '1') { if (result.is_discount == '1') {
if (this.$base.coupon_flag_desc == '') return; if (this.$base.coupon_flag_desc == '') return;
...@@ -2140,7 +2149,7 @@ ...@@ -2140,7 +2149,7 @@
fail: function(err) { fail: function(err) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '图片不在以下 downloadFile 合法域名列表中', title: '图片加载失败',
icon: 'none' icon: 'none'
}); });
} }
...@@ -2362,6 +2371,7 @@ ...@@ -2362,6 +2371,7 @@
setTimeout(function() { setTimeout(function() {
this.$refs['scrollList'].open({ this.$refs['scrollList'].open({
e: this.e_active, e: this.e_active,
goods_id: this.data.goods_id,
queryPage: { queryPage: {
currentId: this.currentId, currentId: this.currentId,
}, },
...@@ -2537,19 +2547,24 @@ ...@@ -2537,19 +2547,24 @@
} else if (e == 99) { //收藏 } else if (e == 99) { //收藏
this.Adlists = this.diy_bannerList this.Adlists = this.diy_bannerList
this.brands = [{ this.brands = [{
icon: "../../static/icon/my.png", icon: "../../static/img/icon_history_sticker.png",
icon_click: "../../static/icon/my-o.png", icon_click: "../../static/img/icon_history_sticker-o.png",
title: "我的" title: "我的历史"
}, },
{ {
icon: "../../static/icon/icon_collection_@2x.png", icon: "../../static/img/my.png",
icon_click: "../../static/icon/icon_collection_@2x.png", icon_click: "../../static/img/my-o.png",
title: "收藏" title: "我的作品"
}, },
{ {
icon: "../../static/icon/icon_good@2x.png", icon: "../../static/img/icon_collection_@2x.png",
icon_click: "../../static/icon/icon_good@2x.png", icon_click: "../../static/img/icon_collection_@2x-o.png",
title: "点赞" title: "我的收藏"
},
{
icon: "../../static/img/icon_good@2x.png",
icon_click: "../../static/img/icon_good@2x-o.png",
title: "我的点赞"
}, },
] ]
if (this.collection_currentId != 0) { if (this.collection_currentId != 0) {
...@@ -2563,6 +2578,7 @@ ...@@ -2563,6 +2578,7 @@
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['scrollList'].open({ this.$refs['scrollList'].open({
e: e, e: e,
goods_id: this.data.goods_id,
queryPage: { queryPage: {
currentId: this.currentId, currentId: this.currentId,
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<view class="start_title" style="margin-top: 120upx;">定制站必须扫码才能使用</view> <view class="start_title" style="margin-top: 120upx;">定制站必须扫码才能使用</view>
</view> </view>
</view> </view>
<!-- 扫码定制 --> <!-- 扫码定制 -->
<view @click="scanning" style="width: 460upx; position: fixed; bottom: 180upx; margin: auto; <view @click="scanning" style="width: 460upx; position: fixed; bottom: 180upx; margin: auto;
height: 164upx; background: #FAD9B1 ; left: 0; right: 0; z-index: 99; border-radius: 20upx; height: 164upx; background: #FAD9B1 ; left: 0; right: 0; z-index: 99; border-radius: 20upx;
......
...@@ -73,6 +73,13 @@ ...@@ -73,6 +73,13 @@
material_series_id: "", material_series_id: "",
}, },
Material_categorydatalist: [], //作品、贴图列表 Material_categorydatalist: [], //作品、贴图列表
historyQueryPage: {
goods_id: "", //产品Id
s: 'Works.myList',
}, //历史对象
datalist: [], //作品、贴图列表 datalist: [], //作品、贴图列表
Material_category: [], //贴图分类 Material_category: [], //贴图分类
currentId: 0, currentId: 0,
...@@ -82,6 +89,7 @@ ...@@ -82,6 +89,7 @@
tip: '', tip: '',
scrollViewTop: 0, //滑动高度 scrollViewTop: 0, //滑动高度
e: 0, //弹窗类型 e: 0, //弹窗类型
isWork: false, //是否作品
}; };
}, },
mounted() { mounted() {
...@@ -91,10 +99,10 @@ ...@@ -91,10 +99,10 @@
* 组件的公有方法列表 * 组件的公有方法列表
*/ */
methods: { methods: {
//作品详情 //作品详情
Worksdetail(item) { Worksdetail(item) {
//console.log(item) //console.log(item)
item.isWork = this.isWork
this.$emit('Worksdetail', item) this.$emit('Worksdetail', item)
}, },
...@@ -131,7 +139,6 @@ ...@@ -131,7 +139,6 @@
setTimeout(e, 500); setTimeout(e, 500);
this.tip = '刷新成功'; this.tip = '刷新成功';
this.queryPage.page = 1 this.queryPage.page = 1
//this.getShapeList()
if (this.type == 99) { if (this.type == 99) {
this.queryCollectionPage.page = 1; this.queryCollectionPage.page = 1;
this.getExcellentMaterial(this.item.queryPage) this.getExcellentMaterial(this.item.queryPage)
...@@ -159,11 +166,10 @@ ...@@ -159,11 +166,10 @@
if (this.e != item.e) { if (this.e != item.e) {
this.datalist = []; this.datalist = [];
} }
this.isWork = false;
this.type = 0; this.type = 0;
this.e = item.e; this.e = item.e;
this.scrollViewTop = 0; this.scrollViewTop = 0;
//let loadData = true;
let loadData = false; let loadData = false;
if (item.e == 23 || item.e == 2) { if (item.e == 23 || item.e == 2) {
if (this.queryPage.material_category_id == item.queryPage.material_category_id) { if (this.queryPage.material_category_id == item.queryPage.material_category_id) {
...@@ -231,6 +237,9 @@ ...@@ -231,6 +237,9 @@
this.item = item; this.item = item;
this.getExcellentMaterial(item.queryPage) this.getExcellentMaterial(item.queryPage)
} else { } else {
if (item.queryPage.currentId == 0) {
this.isWork = true;
}
this.scrollViewTop = this.oldScrollViewTop this.scrollViewTop = this.oldScrollViewTop
this.showState = true; this.showState = true;
} }
...@@ -261,72 +270,98 @@ ...@@ -261,72 +270,98 @@
getExcellentMaterialMore(e) { getExcellentMaterialMore(e) {
uni.showLoading({ if (e.currentId == 0) {
title: '正在加载中...'
}) } else {
let url = '' let url = ''
if (e.currentId == 0) url = '/douyin/Material/getMeMaterial' uni.showLoading({
else if (e.currentId == 1) url = '/douyin/Material/getMeCollection' title: '正在加载中...'
else if (e.currentId == 2) url = '/douyin/Material/getFollowMaterials' })
this.$http.post(url, this.queryCollectionPage).then(result => { if (e.currentId == 1) {
this.showState = true url = '/douyin/Material/getMeMaterial'
if (result.data == null || result.data == "") { } else if (e.currentId == 2) {
url = '/douyin/Material/getMeCollection'
} else if (e.currentId == 3) {
url = '/douyin/Material/getFollowMaterials'
}
this.$http.post(url, this.queryCollectionPage).then(result => {
this.showState = true
if (result.data == null || result.data == "") {
uni.showToast({
title: '没有更多数据了!',
icon: 'none'
});
} else {
this.Material_categorydatalist = this.Material_categorydatalist.concat(result.data
.data);
this.datalist = this.datalist.concat(result.data.data);
this.queryCollectionPage.page += 1;
if (Math.ceil(result.total / result.per_page) <= this.queryCollectionPage.page) {
return setTimeout(() => {
uni.showToast({
title: '没有更多数据了!',
icon: 'none'
});
}, 500);
}
}
uni.hideLoading();
}).catch(err => {
this.showState = true
uni.showToast({ uni.showToast({
title: '没有更多数据了!', title: err.msg,
icon: 'none' icon: 'none'
}); })
} else { uni.hideLoading();
this.Material_categorydatalist = this.Material_categorydatalist.concat(result.data.data); });
this.datalist = this.datalist.concat(result.data.data); }
this.queryCollectionPage.page += 1;
if (Math.ceil(result.total / result.per_page) <= this.queryCollectionPage.page) {
return setTimeout(() => {
uni.showToast({
title: '没有更多数据了!',
icon: 'none'
});
}, 500);
}
}
uni.hideLoading();
}).catch(err => {
this.showState = true
uni.showToast({
title: err.msg,
icon: 'none'
})
uni.hideLoading();
});
}, },
//获取条件
getExcellentMaterial(e) { getExcellentMaterial(e) {
this.datalist = [] this.datalist = []
uni.showLoading({ uni.showLoading({
title: '正在加载中...' title: '正在加载中...'
}) })
let url = '' let url = ''
this.currentId = e.currentId; this.currentId = e.currentId;
if (e.currentId == 0) url = '/douyin/Material/getMeMaterial' if (e.currentId == 0) {
else if (e.currentId == 1) url = '/douyin/Material/getMeCollection' this.isWork = true;
else if (e.currentId == 2) url = '/douyin/Material/getFollowMaterials' this.historyQueryPage.goods_id = this.item.goods_id;
this.$http.post(url, this.queryCollectionPage).then(result => { homeservice.WorksList(this.historyQueryPage).then(result => {
this.showState = true this.datalist = result.data
this.Material_categorydatalist = result.data.data uni.hideLoading();
this.datalist = result.data.data; }).catch(err => {
this.queryCollectionPage.page += 1; uni.showToast({
uni.hideLoading(); title: err.msg,
this.tip = ''; icon: 'none'
}).catch(err => { })
this.showState = true uni.hideLoading();
uni.showToast({ });
title: err.msg, } else {
icon: 'none' this.isWork = false;
}) if (e.currentId == 1) {
uni.hideLoading(); url = '/douyin/Material/getMeMaterial'
}); } else if (e.currentId == 2) {
url = '/douyin/Material/getMeCollection'
} else if (e.currentId == 3) {
url = '/douyin/Material/getFollowMaterials'
}
this.$http.post(url, this.queryCollectionPage).then(result => {
this.Material_categorydatalist = result.data.data
this.datalist = result.data.data;
this.queryCollectionPage.page += 1;
uni.hideLoading();
this.tip = '';
}).catch(err => {
uni.showToast({
title: err.msg,
icon: 'none'
})
uni.hideLoading();
});
}
}, },
}, },
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment