解决视频横竖屏的问题,以及商品列表的问题

This commit is contained in:
jia 2023-09-08 10:15:07 +08:00
parent 1e79bf35d1
commit 98fff8a58b
8 changed files with 170 additions and 153 deletions

View File

@ -23,7 +23,7 @@
require: true require: true
}, },
userid: { userid: {
type: String|Number, type: String | Number,
require: true require: true
}, },
}, },
@ -38,22 +38,29 @@
methods: { methods: {
gogogo(item) { gogogo(item) {
if (item.video_link.length > 0) { if (this.userid) {
uni.navigateTo({ if (item.video_link.length > 0) {
// #ifdef MP || H5 uni.navigateTo({
url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1` // #ifdef MP || H5
// #endif url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
// #ifdef APP // #endif
url: `/pages/short_video/appSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1` // #ifdef APP
// #endif url: `/pages/short_video/appSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
}) // #endif
})
} else {
uni.navigateTo({
url: `/pages/plantGrass/plant_detail/index?id=${item.community_id}`
})
}
} else { } else {
uni.navigateTo({ this.$util.Tips({
url: `/pages/plantGrass/plant_detail/index?id=${item.community_id}` title: '用户信息不存在,请完成登录在进行该操作',
icon: 'error'
}) })
} }
}, },
} }

View File

@ -116,12 +116,12 @@
<view class="t_title">任务名称</view> <view class="t_title">任务名称</view>
<view class="tips">{{ item.remark }}</view> <view class="tips">{{ item.remark }}</view>
</view> </view>
<!--<view class="t_item"> <!--<view class="t_item">
<view class="t_title">金额归属</view> <view class="t_title">金额归属</view>
<view class="tips">{{ <view class="tips">{{
$store.state.app.userInfo.nickname $store.state.app.userInfo.nickname
}}</view> }}</view>
</view> --> </view> -->
<view class="t_item"> <view class="t_item">
<view class="t_title">收益来源</view> <view class="t_title">收益来源</view>

View File

@ -23,7 +23,7 @@
</view> </view>
<view class="content-two_one" v-if="item.type==1"> <view class="content-two_one" v-if="item.type==1">
<view class="content-two-edita" @click="soldEdit(item)"> <view class="content-two-edita" @click="soldEdit">
待处理 待处理
</view> </view>
<view class="contentgn"> <view class="contentgn">

View File

@ -23,7 +23,7 @@
<view v-if="followDetail.author" class="title"> <view v-if="followDetail.author" class="title">
<view class="author"> <view class="author">
<navigator hover-class="none" :url="'/pages/plantGrass/plant_user/index?id='+followDetail.uid"> <navigator hover-class="none" :url="'/pages/plantGrass/plant_user/index?id='+followDetail.uid">
<image class="picture" :src="followDetail.author.avatar || '/static/images/f.png'"></image> <image class="picture" :src="followDetail.author.avatar || '/static/images/f.png'" mode="aspectFit"></image>
</navigator> </navigator>
<view class="name acea-row"> <view class="name acea-row">
<text>{{followDetail.author.nickname}}</text> <text>{{followDetail.author.nickname}}</text>

View File

@ -401,7 +401,7 @@
newTime: 0, //跟手滑动后的最新时间💗 newTime: 0, //跟手滑动后的最新时间💗
timeNumber: 0, //🌟💗 timeNumber: 0, //🌟💗
ProgressBarBottom: 20, //进度条离底部的距离💗 ProgressBarBottom: 20, //进度条离底部的距离💗
object_fit: 'cover', //视频样式默认包含🌟💗 object_fit: 'contain', //视频样式默认包含🌟💗
mode: 'aspectFit', //图片封面样式🌟💗 mode: 'aspectFit', //图片封面样式🌟💗
timeout: "", //🌟用来阻止 setTimeout()方法 timeout: "", //🌟用来阻止 setTimeout()方法
voice: "", //🌟用来阻止 setTimeout()方法 voice: "", //🌟用来阻止 setTimeout()方法
@ -1116,7 +1116,7 @@
/* #ifdef MP */ /* #ifdef MP */
padding-top: 200rpx; padding-top: 200rpx;
/* #endif */ /* #endif */
// background-color: #000000; background-color: #000000;
background-color: #F5F5F5; background-color: #F5F5F5;
.goods_item { .goods_item {
@ -1238,7 +1238,7 @@
left: 0; left: 0;
top: 70rpx; top: 70rpx;
height: 86rpx; height: 86rpx;
.icon-xiangzuo { .icon-xiangzuo {
margin-left: 10px; margin-left: 10px;

View File

@ -616,10 +616,8 @@
if (this.type == 'edit') { if (this.type == 'edit') {
this.formData.product_info = [] this.formData.product_info = []
} }
this.productList = [] this.productList = []
this.price = 0; this.price = 0;
if (data.length > 0) { if (data.length > 0) {
this.productList = data; this.productList = data;
for (let i in data) { for (let i in data) {

View File

@ -8,10 +8,10 @@
<text class='phone'>{{addressInfo.phone}}</text> <text class='phone'>{{addressInfo.phone}}</text>
</view> </view>
<view> <view>
<text class='default t-color'
v-if="addressInfo.is_default">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street || ''}}{{typeof(addressInfo.brigade)=='string'?addressInfo.brigade:addressInfo.brigade.name }}{{addressInfo.detail}}
<text class='default t-color'
v-if="addressInfo.is_default">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street || ''}}
<text v-if='addressInfo.brigade'>{{typeof(addressInfo.brigade)=='string'?addressInfo.brigade:addressInfo.brigade.name }}{{addressInfo.detail}}</text>
</view> </view>
</view> </view>
<navigator v-else :url="'/pages/users/user_address/index?cartId='+cartId" hover-class="none" <navigator v-else :url="'/pages/users/user_address/index?cartId='+cartId" hover-class="none"
@ -1083,7 +1083,7 @@
that.order_key = res.data.key that.order_key = res.data.key
that.cartArr[4].title = that.cartArr[4].title =
`结算周期:${res.data.order[0].settle_cycle}天 日利率:${res.data.order[0].interest_rate}%` `结算周期:${res.data.order[0].settle_cycle}天 日利率:${res.data.order[0].interest_rate}%`
console.log(res.data.order[0]);
if (res.data.order[0].credit_buy == 1 && this.type_id == 12) { if (res.data.order[0].credit_buy == 1 && this.type_id == 12) {
this.cartArr[4].payStatus = 1 this.cartArr[4].payStatus = 1
} else { } else {
@ -1126,7 +1126,7 @@
real_name: res.data.real_name, real_name: res.data.real_name,
phone: res.data.phone phone: res.data.phone
} }
console.log(that.addressId);
this.$nextTick(() => { this.$nextTick(() => {
this.getConfirm(that.addressId); this.getConfirm(that.addressId);
}) })

View File

@ -1,4 +1,9 @@
import { getGXconfig } from "@/api/uniMP.js"; import {
getGXconfig
} from "@/api/uniMP.js";
import {
HTTP_REQUEST_URL
} from '@/config/app';
const mp = uni.requireNativePlugin('uniMP'); const mp = uni.requireNativePlugin('uniMP');
let appid = ''; // 应用id let appid = ''; // 应用id
@ -7,146 +12,153 @@ let timer = null; // 加载计时器
// 比较版本号大小 // 比较版本号大小
function compareVersions(version1, version2) { function compareVersions(version1, version2) {
const arr1 = version1.split('.').map(Number); const arr1 = version1.split('.').map(Number);
const arr2 = version2.split('.').map(Number); const arr2 = version2.split('.').map(Number);
for (let i = 0; i < Math.max(arr1.length, arr2.length); i++) { for (let i = 0; i < Math.max(arr1.length, arr2.length); i++) {
const num1 = i < arr1.length ? arr1[i] : 0; const num1 = i < arr1.length ? arr1[i] : 0;
const num2 = i < arr2.length ? arr2[i] : 0; const num2 = i < arr2.length ? arr2[i] : 0;
if (num1 > num2) { if (num1 > num2) {
return 1; return 1;
} else if (num1 < num2) { } else if (num1 < num2) {
return -1; return -1;
} }
} }
return 0; return 0;
} }
// 加载小程序 // 加载小程序
const loadMP = async (id) => { const loadMP = async (id) => {
appid = id; appid = id;
let info = await getGXconfig(); let info = await getGXconfig();
console.log('最新版本', info.data); console.log('最新版本', info.data);
console.log(mp, uni); console.log(mp, uni);
// return ; // return ;
uni.showLoading({ uni.showLoading({
title: '下载中...', title: '下载中...',
mask: true mask: true
}) })
mp.getUniMPVersion(id, (ret) => { mp.getUniMPVersion(id, (ret) => {
console.log('当前版本', ret); console.log('当前版本', ret);
if (0 != ret.code || compareVersions(info.data.version, ret.versionInfo.name) == 1 || true) { let flag;
let count = 0; if (HTTP_REQUEST_URL == 'https://shop.lihaink.cn') {
timer = setInterval(() => { flag = false
if (count < 100) uni.showLoading({ } else {
title: `下载中... ${count}%`, flag = true
mask: true }
}) if (0 != ret.code || compareVersions(info.data.version, ret.versionInfo.name) == 1 || flag ==
else uni.showLoading({ true) {
title: '安装中...', let count = 0;
mask: true timer = setInterval(() => {
}) if (count < 100) uni.showLoading({
}, 600) title: `下载中... ${count}%`,
let downloadTask = uni.downloadFile({ mask: true
url: info.data.version_info?.dow_url, })
success(res) { else uni.showLoading({
wgtFile = res.tempFilePath; title: '安装中...',
console.log('下载完成', wgtFile); mask: true
installMP(); })
} }, 600)
}); let downloadTask = uni.downloadFile({
downloadTask.onProgressUpdate((res) => { url: info.data.version_info?.dow_url,
// console.log('下载进度' + res.progress); success(res) {
if (res.progress > count) count += 10; wgtFile = res.tempFilePath;
if (count >= 90) { console.log('下载完成', wgtFile);
clearInterval(timer); installMP();
timer = null; }
} });
}); downloadTask.onProgressUpdate((res) => {
} else { // console.log('下载进度' + res.progress);
open() if (res.progress > count) count += 10;
} if (count >= 90) {
}); clearInterval(timer);
timer = null;
}
});
} else {
open()
}
});
}; };
// 小程序版本信息 // 小程序版本信息
const getVersion = (id) => { const getVersion = (id) => {
appid = id; appid = id;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
mp.getUniMPVersion(appid, (ret) => { mp.getUniMPVersion(appid, (ret) => {
console.log('供销', ret); console.log('供销', ret);
}); });
}) })
} }
// 安装小程序 // 安装小程序
const installMP = () => { const installMP = () => {
mp.getUniMPVersion(appid, (ret) => { mp.getUniMPVersion(appid, (ret) => {
console.log('安装:供销', ret); console.log('安装:供销', ret);
doInstallMP(); doInstallMP();
// if (0 != ret.code) { //获取失败时安装应用 // if (0 != ret.code) { //获取失败时安装应用
// doInstallMP(); // doInstallMP();
// } else { // } else {
// uni.showModal({ // uni.showModal({
// title: '提示', // title: '提示',
// content: 'uni小程序已安装是否覆盖', // content: 'uni小程序已安装是否覆盖',
// success: res => { // success: res => {
// res.confirm && doInstallMP(); // res.confirm && doInstallMP();
// } // }
// }); // });
// } // }
console.log('getUniMPVersion: ' + JSON.stringify(ret)); console.log('getUniMPVersion: ' + JSON.stringify(ret));
}); });
}; };
const doInstallMP = () => { const doInstallMP = () => {
mp.installUniMP({ mp.installUniMP({
appid: appid, appid: appid,
wgtFile: wgtFile wgtFile: wgtFile
}, (r) => { }, (r) => {
if (0 == r.code) { if (0 == r.code) {
// uni.showToast({ // uni.showToast({
// title: '安装成功' // title: '安装成功'
// }); // });
console.log('小程序安装成功'); console.log('小程序安装成功');
open(); open();
} else { } else {
uni.hideLoading(); uni.hideLoading();
uni.showModal({ uni.showModal({
title: '安装失败', title: '安装失败',
content: JSON.stringify(r), content: JSON.stringify(r),
showCancel: false showCancel: false
}); });
} }
console.log('安装供销: ' + JSON.stringify(r)); console.log('安装供销: ' + JSON.stringify(r));
}); });
}; };
const open = (id = null) => { const open = (id = null) => {
let token = uni.getStorageSync('LOGIN_STATUS_TOKEN'); let token = uni.getStorageSync('LOGIN_STATUS_TOKEN');
if (!token) return uni.showToast({ if (!token) return uni.showToast({
icon: 'none', icon: 'none',
title: '请先登录' title: '请先登录'
}) })
mp.openUniMP({ mp.openUniMP({
appid: id || appid, appid: id || appid,
extraData: { extraData: {
uniMP: true, uniMP: true,
token: token, token: token,
} }
}, (ret) => { }, (ret) => {
uni.hideLoading(); uni.hideLoading();
if (0 != ret.code) { if (0 != ret.code) {
uni.showModal({ uni.showModal({
title: '启动失败', title: '启动失败',
content: JSON.stringify(ret), content: JSON.stringify(ret),
showCancel: false showCancel: false
}); });
} }
console.log('openUniMP: ' + JSON.stringify(ret)); console.log('openUniMP: ' + JSON.stringify(ret));
}); });
} }
export default { export default {
loadMP, loadMP,
installMP, installMP,
doInstallMP, doInstallMP,
getVersion, getVersion,
open open
} }