Commit 721e47e5 authored by 黄奎's avatar 黄奎

页面修改

parent 804aa513
<template> <template>
<view class="indexpage"> <view class="indexpage">
<view class="topBox"> <view class="topBox">
<image <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/bg.png" mode="widthFix" class="bg" />
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/bg.png" <view class="topinfo">
mode="widthFix" <view class="flex-center">
class="bg" <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/cash.png" class="headimg" />
/> <view class="name1">饭粒汪</view>
<view class="topinfo"> </view>
<view class="flex-center"> <view style="
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/cash.png"
class="headimg"
/>
<view class="name1">饭粒汪</view>
</view>
<view
style="
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
width: 100rpx; width: 100rpx;
" ">
> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/qr_code.png" class="ewmimg"
<image mode="aspectFill" />
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/qr_code.png" <view class="name2">收款码</view>
class="ewmimg" </view>
mode="aspectFill" </view>
/> <view class="msgBox flex-center">
<view class="name2">收款码</view> <view class="itemBox">
</view> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/order.png" mode="" class="imgicon" />
</view> <view class="iconname">订单消息</view>
<view class="msgBox flex-center"> <view class="tipNum">1</view>
<view class="itemBox"> </view>
<image <view class="itemBox">
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/order.png" <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/msg.png" mode="" class="imgicon" />
mode="" <view class="iconname">审核消息</view>
class="imgicon" </view>
/> <view class="itemBox">
<view class="iconname">订单消息</view> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/cash.png" mode="" class="imgicon" />
<view class="tipNum">1</view> <view class="iconname">提现申请</view>
</view> </view>
<view class="itemBox"> <view class="itemBox">
<image <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/comment.png" mode="" class="imgicon" />
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/msg.png" <view class="iconname">评论管理</view>
mode="" </view>
class="imgicon" <view class="itemBox">
/> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/user.png" mode="" class="imgicon" />
<view class="iconname">审核消息</view> <view class="iconname">用户管理</view>
</view> </view>
<view class="itemBox"> </view>
<image </view>
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/cash.png" <view class="conditionOfBusiness">
mode="" <view class="title">经营状况</view>
class="imgicon" <view class="day flex-center">
/> <!-- <view class="dayitem choose">今日</view>
<view class="iconname">提现申请</view>
</view>
<view class="itemBox">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/comment.png"
mode=""
class="imgicon"
/>
<view class="iconname">评论管理</view>
</view>
<view class="itemBox">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/user.png"
mode=""
class="imgicon"
/>
<view class="iconname">用户管理</view>
</view>
</view>
</view>
<view class="conditionOfBusiness">
<view class="title">经营状况</view>
<view class="day flex-center">
<!-- <view class="dayitem choose">今日</view>
<view class="dayitem">昨日</view> --> <view class="dayitem">昨日</view> -->
<view <view class="dayitem" @click="handleClickDate('first')" :class="{ choose: clickDate == 'first' }">7日</view>
class="dayitem" <view class="dayitem" @click="handleClickDate('second')" :class="{ choose: clickDate == 'second' }">30日</view>
@click="handleClickDate('first')" </view>
:class="{ choose: clickDate == 'first' }" <view class="BusinessData">
>7日</view <view class="dataitem">
> <view class="dataNum">0</view>
<view <view class="dataName">支付订单数</view>
class="dayitem" </view>
@click="handleClickDate('second')" <view class="dataitem">
:class="{ choose: clickDate == 'second' }" <view class="dataNum">0.00</view>
>30日</view <view class="dataName">支付金额(元)</view>
> </view>
</view> <view class="dataitem">
<view class="BusinessData"> <view class="dataNum">2</view>
<view class="dataitem"> <view class="dataName">访客数</view>
<view class="dataNum">0</view> </view>
<view class="dataName">支付订单数</view> <view class="dataitem">
</view> <view class="dataNum">116</view>
<view class="dataitem"> <view class="dataName">访问量</view>
<view class="dataNum">0.00</view> </view>
<view class="dataName">支付金额(元)</view> </view>
</view> </view>
<view class="dataitem"> <view class="fastHandle">
<view class="dataNum">2</view> <view class="title">快速处理</view>
<view class="dataName">访客数</view> <view class="flex-center HandleBox">
</view> <view class="handleItem">
<view class="dataitem"> <view class="handleItemNum">0</view>
<view class="dataNum">116</view> <view class="handleItemName">待发货订单</view>
<view class="dataName">访问量</view> <view class="handleItemBtn">立即发货 <u-icon name="arrow"></u-icon>
</view> </view>
</view> </view>
</view> <view class="handleItem">
<view class="fastHandle"> <view class="handleItemNum">0</view>
<view class="title">快速处理</view> <view class="handleItemName">维权订单</view>
<view class="flex-center HandleBox"> <view class="handleItemBtn">立即处理 <u-icon name="arrow"></u-icon>
<view class="handleItem"> </view>
<view class="handleItemNum">0</view> </view>
<view class="handleItemName">待发货订单</view> </view>
<view class="handleItemBtn" </view>
>立即发货 <u-icon name="arrow"></u-icon> <view class="echartsBox">
</view> <view class="title flex-center">
</view> <picker @change="bindPickerChange" :value="key" :range="array" range-key="name">
<view class="handleItem"> <view class="payType">{{ payType }}
<view class="handleItemNum">0</view> <u-icon name="arrow-down"></u-icon>
<view class="handleItemName">维权订单</view> </view>
<view class="handleItemBtn" </picker>
>立即处理 <u-icon name="arrow"></u-icon> <picker @change="bindPickerChange1" :value="key" :range="array1" range-key="name">
</view> <view class="payType">{{ payType1 }}
</view> <u-icon name="arrow-down"></u-icon>
</view> </view>
</view> </picker>
<view class="echartsBox"> </view>
<view class="title flex-center"> <view class="day flex-center">
<picker <!-- <view class="dayitem choose">今日</view>
@change="bindPickerChange"
:value="key"
:range="array"
range-key="name"
>
<view class="payType"
>{{ payType }}
<u-icon name="arrow-down"></u-icon>
</view>
</picker>
<picker
@change="bindPickerChange1"
:value="key"
:range="array1"
range-key="name"
>
<view class="payType"
>{{ payType1 }}
<u-icon name="arrow-down"></u-icon>
</view>
</picker>
</view>
<view class="day flex-center">
<!-- <view class="dayitem choose">今日</view>
<view class="dayitem">昨日</view> --> <view class="dayitem">昨日</view> -->
<view <view class="dayitem" @click="handleClickDate('first')" :class="{ choose: clickDate == 'first' }">7日</view>
class="dayitem" <view class="dayitem" @click="handleClickDate('second')" :class="{ choose: clickDate == 'second' }">30日</view>
@click="handleClickDate('first')" </view>
:class="{ choose: clickDate == 'first' }" <view style="height: 100rpx"></view>
>7日</view <canvas canvas-id="canvasColumn" id="canvasColumn" class="charts" disable-scroll="true" @touchstart="touchColumn"
> @touchmove="moveColumn" @touchend="touchEndColumn">
<view </canvas>
class="dayitem" </view>
@click="handleClickDate('second')" <tabbar></tabbar>
:class="{ choose: clickDate == 'second' }" </view>
>30日</view
>
</view>
<view style="height: 100rpx"></view>
<canvas
canvas-id="canvasColumn"
id="canvasColumn"
class="charts"
disable-scroll="true"
@touchstart="touchColumn"
@touchmove="moveColumn"
@touchend="touchEndColumn"
>
</canvas>
</view>
<tabbar></tabbar>
</view>
</template> </template>
<script> <script>
import uCharts from "../school/components/u-charts/u-charts.min.js"; import uCharts from "../school/components/u-charts/u-charts.min.js";
import tabbar from "./components/tabbar.vue"; import tabbar from "./components/tabbar.vue";
var canvaColumn = null; var canvaColumn = null;
var _self; var _self;
export default { export default {
components: { components: {
tabbar, tabbar,
}, },
data() { data() {
return { return {
array: [ array: [{
{ name: "支付金额",
name: "支付金额", key: 1,
key: 1, },
}, {
{ name: "支付订单数",
name: "支付订单数", key: 2,
key: 2, },
}, {
{ name: "支付人数",
name: "支付人数", key: 3,
key: 3, },
}, {
{ name: "支付件数",
name: "支付件数", key: 4,
key: 4, },
}, ],
], payType: "",
payType: "", array1: [{
array1: [ name: "全部",
{ key: 1,
name: "全部", },
key: 1, {
}, name: "商城",
{ key: 2,
name: "商城", },
key: 2, {
}, name: "拼团",
{ key: 3,
name: "拼团", },
key: 3, {
}, name: "积分",
{ key: 4,
name: "积分", },
key: 4, ],
}, payType1: "",
], //加载
payType1: "", loading: false,
//加载 clickDate: "first",
loading: false, dateStr: [], //日期
clickDate: "first", //查询数据
dateStr: [], //日期 basicQMsg: {
//查询数据 Source: 0, //来源
basicQMsg: { StartDate: "", //开始时间
Source: 0, //来源 EndDate: "", //结束时间
StartDate: "", //开始时间 SalesTimeType: 0, //默认今日
EndDate: "", //结束时间 OrderBy: "",
SalesTimeType: 0, //默认今日 UserType: -1, //0-普通用户,1-领队导游
OrderBy: "", },
UserType: -1, //0-普通用户,1-领队导游 basicData: {}, //基础数据
}, salesData: {}, //销售数据
basicData: {}, //基础数据 };
salesData: {}, //销售数据 },
}; methods: {
}, bindPickerChange(e) {
methods: { this.payType = this.array[e.detail.value].name;
bindPickerChange(e) { },
this.payType = this.array[e.detail.value].name; bindPickerChange1(e) {
}, this.payType1 = this.array1[e.detail.value].name;
bindPickerChange1(e) { },
this.payType1 = this.array1[e.detail.value].name; showColumn(canvasId, chartData) {
}, canvaColumn = new uCharts({
showColumn(canvasId, chartData) { $this: _self,
canvaColumn = new uCharts({ canvasId: canvasId,
$this: _self, type: "column",
canvasId: canvasId, fontSize: 11,
type: "column", padding: [5, 15, 15, 15],
fontSize: 11, legend: {
padding: [5, 15, 15, 15], show: true,
legend: { position: "top",
show: true, float: "center",
position: "top", itemGap: 30,
float: "center", padding: 5,
itemGap: 30, margin: 5,
padding: 5, //backgroundColor:'rgba(41,198,90,0.2)',
margin: 5, //borderColor :'rgba(41,198,90,0.5)',
//backgroundColor:'rgba(41,198,90,0.2)', borderWidth: 1,
//borderColor :'rgba(41,198,90,0.5)', },
borderWidth: 1, dataLabel: true,
}, dataPointShape: true,
dataLabel: true, background: "#FFFFFF",
dataPointShape: true, pixelRatio: _self.pixelRatio,
background: "#FFFFFF", categories: chartData.categories,
pixelRatio: _self.pixelRatio, series: chartData.series,
categories: chartData.categories, animation: true,
series: chartData.series, enableScroll: true,
animation: true, xAxis: {
enableScroll: true, disableGrid: false,
xAxis: { type: "grid",
disableGrid: false, gridType: "dash",
type: "grid", itemCount: 4,
gridType: "dash", scrollShow: true,
itemCount: 4, scrollAlign: "right",
scrollShow: true, },
scrollAlign: "right", yAxis: {
}, //disabled:true
yAxis: { gridType: "dash",
//disabled:true splitNumber: 4,
gridType: "dash", min: 10,
splitNumber: 4, max: 180,
min: 10, format: (val) => {
max: 180, return val.toFixed(0) + "元";
format: (val) => { }, //如不写此方法,Y轴刻度默认保留两位小数
return val.toFixed(0) + "元"; },
}, //如不写此方法,Y轴刻度默认保留两位小数 width: _self.cWidth * _self.pixelRatio,
}, height: _self.cHeight * _self.pixelRatio,
width: _self.cWidth * _self.pixelRatio, extra: {
height: _self.cHeight * _self.pixelRatio, column: {
extra: { type: "group",
column: { width: (_self.cWidth * _self.pixelRatio * 0.45) /
type: "group", chartData.categories.length,
width: },
(_self.cWidth * _self.pixelRatio * 0.45) / },
chartData.categories.length, });
}, },
}, touchColumn(e) {
}); canvaColumn.scrollStart(e);
}, },
touchColumn(e) { moveColumn(e) {
canvaColumn.scrollStart(e); canvaColumn.scroll(e);
}, },
moveColumn(e) { touchEndColumn(e) {
canvaColumn.scroll(e); canvaColumn.scrollEnd(e);
}, canvaColumn.touchLegend(e, {
touchEndColumn(e) { animation: true,
canvaColumn.scrollEnd(e); });
canvaColumn.touchLegend(e, { canvaColumn.showToolTip(e, {
animation: true, format: function(item, category) {
}); return category + " " + item.name + ":" + item.data + "元";
canvaColumn.showToolTip(e, { },
format: function (item, category) { });
return category + " " + item.name + ":" + item.data + "元"; },
}, //基础数据日期切换
}); handleClickDate(name) {
}, this.clickDate = name;
//基础数据日期切换 this.dateStr = [];
handleClickDate(name) { //7日
this.clickDate = name; if (name == "first") {
this.dateStr = []; this.dateStr.push(this.$utils.AddDay("", -7));
//7日 }
if (name == "first") { //30日
this.dateStr.push(this.$utils.AddDay("", -7)); else if (name == "second") {
} this.dateStr.push(this.$utils.AddDay("", -30));
//30日 }
else if (name == "second") { this.dateStr.push(this.$utils.AddDay("", -0));
this.dateStr.push(this.$utils.AddDay("", -30)); this.getBasicData();
} },
this.dateStr.push(this.$utils.AddDay("", -0)); //获取基础数据
this.getBasicData(); getBasicData() {
}, this.loading = true;
//获取基础数据 console.log("adsfasdasf")
getBasicData() { if (this.dateStr && this.dateStr.length > 0) {
this.loading = true; this.basicQMsg.StartDate = this.dateStr[0];
if (this.dateStr && this.dateStr.length > 0) { this.basicQMsg.EndDate = this.dateStr[1];
this.basicQMsg.StartDate = this.dateStr[0]; } else {
this.basicQMsg.EndDate = this.dateStr[1]; this.basicQMsg.StartDate = "";
} else { this.basicQMsg.EndDate = "";
this.basicQMsg.StartDate = ""; }
this.basicQMsg.EndDate = ""; this.requestAdmin("/api/Tenant/MallIndexStatistics", this.basicQMsg, (res) => {
} console.log("11111")
this.apipost("/api/Tenant/MallIndexStatistics", this.basicQMsg, (res) => { //this.loading = false;
this.loading = false; if (res.data.resultCode == 1) {
if (res.data.resultCode == 1) { //基础数据统计
//基础数据统计 this.basicData = res.data.data.basicData;
this.basicData = res.data.data.basicData; //销售情况统计
//销售情况统计 this.salesData = res.data.data.salesData;
this.salesData = res.data.data.salesData; // //商品购买力TOP排行
// //商品购买力TOP排行 // var saleGoodsArray = res.data.data.saleIncomeData;
// var saleGoodsArray = res.data.data.saleIncomeData; // if (saleGoodsArray) {
// if (saleGoodsArray) { // if (saleGoodsArray.length <= 2) {
// if (saleGoodsArray.length <= 2) { // this.saleIncomeData = saleGoodsArray;
// this.saleIncomeData = saleGoodsArray; // } else {
// } else { // this.saleIncomeData = saleGoodsArray.slice(0, 15);
// this.saleIncomeData = saleGoodsArray.slice(0, 15); // }
// } // }
// } // //用户购买力TOP排行
// //用户购买力TOP排行 // var saleUserArray = res.data.data.saleUserData;
// var saleUserArray = res.data.data.saleUserData; // if (saleUserArray) {
// if (saleUserArray) { // if (saleUserArray.length <= 2) {
// if (saleUserArray.length <= 2) { // this.saleUserData = saleUserArray;
// this.saleUserData = saleUserArray; // } else {
// } else { // this.saleUserData = saleUserArray.slice(0, 15);
// this.saleUserData = saleUserArray.slice(0, 15); // }
// } // }
// } // this.initMap();
// this.initMap(); } else {
} else { // this.Info(res.data.message);
// this.Info(res.data.message); }
} });
}); },
}, },
}, onLoad() {
onLoad() { this.payType = this.array[0].name;
this.payType = this.array[0].name; this.payType1 = this.array1[0].name;
this.payType1 = this.array1[0].name; uni.setNavigationBarTitle({
uni.setNavigationBarTitle({ title: "商城管理",
title: "商城管理", });
}); this.getBasicData()
this.getBasicData() },
}, };
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.indexpage { .indexpage {
min-height: 100vh; min-height: 100vh;
background-color: #f7f7f7; background-color: #f7f7f7;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 100rpx; padding-bottom: 100rpx;
} }
.flex-center { .flex-center {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.topBox { .topBox {
height: 350rpx; height: 350rpx;
position: relative; position: relative;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.bg { .bg {
width: 100%; width: 100%;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 0; z-index: 0;
} }
.topinfo { .topinfo {
height: 130rpx; height: 130rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 50rpx 0 20rpx; padding: 0 50rpx 0 20rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
width: 100%; width: 100%;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 1; z-index: 1;
} }
.headimg { .headimg {
width: 70rpx; width: 70rpx;
height: 70rpx; height: 70rpx;
border-radius: 50%; border-radius: 50%;
} }
.name1 { .name1 {
margin-left: 24rpx; margin-left: 24rpx;
font-size: 40rpx; font-size: 40rpx;
color: #fff; color: #fff;
} }
.ewmimg { .ewmimg {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
} }
.name2 { .name2 {
font-size: 24rpx; font-size: 24rpx;
color: #fff; color: #fff;
} }
.msgBox { .msgBox {
box-sizing: border-box; box-sizing: border-box;
width: 700rpx; width: 700rpx;
height: 200rpx; height: 200rpx;
border-radius: 12rpx; border-radius: 12rpx;
background-color: #fff; background-color: #fff;
z-index: 5; z-index: 5;
position: absolute; position: absolute;
top: 130rpx; top: 130rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
z-index: 1; z-index: 1;
padding: 0 30rpx; padding: 0 30rpx;
.itemBox { .itemBox {
width: 100rpx; width: 100rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
position: relative; position: relative;
.imgicon { .imgicon {
width: 90rpx; width: 90rpx;
height: 90rpx; height: 90rpx;
border-radius: 50%; border-radius: 50%;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.tipNum { .tipNum {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
z-index: 2; z-index: 2;
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
border-radius: 50%; border-radius: 50%;
background-color: #f00; background-color: #f00;
text-align: center; text-align: center;
line-height: 28rpx; line-height: 28rpx;
color: #fff; color: #fff;
font-size: 20rpx; font-size: 20rpx;
} }
.iconname { .iconname {
font-size: 24rpx; font-size: 24rpx;
} }
} }
} }
.conditionOfBusiness, .conditionOfBusiness,
.echartsBox { .echartsBox {
height: 480rpx; height: 480rpx;
width: 700rpx; width: 700rpx;
margin: 0 auto; margin: 0 auto;
border-radius: 12rpx; border-radius: 12rpx;
background-color: #fff; background-color: #fff;
box-sizing: border-box; box-sizing: border-box;
padding: 30rpx 50rpx; padding: 30rpx 50rpx;
margin-bottom: 40rpx; margin-bottom: 40rpx;
.day { .day {
width: 300rpx; width: 300rpx;
height: 50rpx; height: 50rpx;
border-radius: 25rpx; border-radius: 25rpx;
border: 2rpx solid #667cb8; border: 2rpx solid #667cb8;
overflow: hidden; overflow: hidden;
margin: 0 auto; margin: 0 auto;
.dayitem { .dayitem {
width: 150rpx; width: 150rpx;
height: 100%; height: 100%;
font-size: 24rpx; font-size: 24rpx;
text-align: center; text-align: center;
line-height: 48rpx; line-height: 48rpx;
} }
} }
.choose { .choose {
background-color: #446dfc; background-color: #446dfc;
} }
.BusinessData { .BusinessData {
width: 590rpx; width: 590rpx;
height: 280rpx; height: 280rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.dataitem { .dataitem {
width: 50%; width: 50%;
height: 50%; height: 50%;
padding-top: 50rpx; padding-top: 50rpx;
padding-left: 30rpx; padding-left: 30rpx;
.dataNum { .dataNum {
font-size: 40rpx; font-size: 40rpx;
color: #446dfc; color: #446dfc;
margin-bottom: 2rpx; margin-bottom: 2rpx;
} }
.dataName { .dataName {
font-size: 24rpx; font-size: 24rpx;
} }
} }
} }
} }
.title { .title {
font-size: 30rpx; font-size: 30rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.fastHandle { .fastHandle {
width: 700rpx; width: 700rpx;
// height: 300rpx; // height: 300rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 40rpx; margin-bottom: 40rpx;
border-radius: 12rpx; border-radius: 12rpx;
background-color: #fff; background-color: #fff;
padding: 40rpx; padding: 40rpx;
.HandleBox { .HandleBox {
.handleItem { .handleItem {
width: 300rpx; width: 300rpx;
height: 180rpx; height: 180rpx;
border-radius: 12rpx; border-radius: 12rpx;
box-shadow: 0rpx 0rpx 10rpx 0px rgba(36, 36, 36, 0.2); box-shadow: 0rpx 0rpx 10rpx 0px rgba(36, 36, 36, 0.2);
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
.handleItemNum { .handleItemNum {
font-size: 40rpx; font-size: 40rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.handleItemName { .handleItemName {
font-size: 26rpx; font-size: 26rpx;
margin-bottom: 15rpx; margin-bottom: 15rpx;
color: #9b9b9b; color: #9b9b9b;
} }
.handleItemBtn { .handleItemBtn {
font-size: 26rpx; font-size: 26rpx;
color: #9b9b9b; color: #9b9b9b;
display: flex; display: flex;
align-items: center; align-items: center;
} }
} }
} }
} }
.echartsBox { .echartsBox {
width: 700rpx; width: 700rpx;
height: auto; height: auto;
margin: 0 auto; margin: 0 auto;
margin-bottom: 40rpx; margin-bottom: 40rpx;
.payType { .payType {
display: flex; display: flex;
font-size: 30rpx; font-size: 30rpx;
} }
} }
</style> </style>
export default { export default {
install(Vue, options) { install(Vue, options) {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285" Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
// Vue.prototype.host2 = "http://192.168.0.110:8200"
// Vue.prototype.host2 = "https://mallApi.oytour.com" Vue.prototype.host2 = "http://localhost:5000"
Vue.prototype.host2 = "http://192.168.20.6:8088" //Vue.prototype.host2 = "https://mallApi.oytour.com"
// Vue.prototype.host2 = "http://192.168.20.24:8200"
// Vue.prototype.host2 = "http://192.168.20.17:8014" Vue.prototype.UploadConfig = function() { //本地上传配置
// Vue.prototype.host2 = "http://192.168.20.17:8014"
// Vue.prototype.host2 = "http://testmall.oytour.com/"
Vue.prototype.UploadConfig = function() {//本地上传配置
return { return {
UploadUrl:this.host2.indexOf('mallApi')!=-1 ? "https://upload.oytour.com/Upload/AppUpload":"http://192.168.20.214:8120/Upload/AppUpload", UploadUrl: this.host2.indexOf('mallApi') != -1 ? "https://upload.oytour.com/Upload/AppUpload" : "http://192.168.20.214:8120/Upload/AppUpload",
ImageUrl:this.host2.indexOf('mallApi')!=-1? "https://imgfile.oytour.com":"http://192.168.20.214:8130", ImageUrl: this.host2.indexOf('mallApi') != -1 ? "https://imgfile.oytour.com" : "http://192.168.20.214:8130",
} }
} }
//微宝阁请求
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
//网络请求 //网络请求
uni.request({ uni.request({
...@@ -36,8 +34,8 @@ export default { ...@@ -36,8 +34,8 @@ export default {
} }
}); });
} }
//小程序常规请求
Vue.prototype.request2 = function(param, success, failed) { Vue.prototype.request2 = function(param, success, failed) {
//网络请求
uni.request({ uni.request({
url: this.host2 + param.url, url: this.host2 + param.url,
method: param.method || "Post", method: param.method || "Post",
...@@ -59,7 +57,6 @@ export default { ...@@ -59,7 +57,6 @@ export default {
let u = uni.getStorageSync("mall_UserInfo"); let u = uni.getStorageSync("mall_UserInfo");
if (u) { if (u) {
this.getLogin_t(u) this.getLogin_t(u)
// typeof failed == "function" && failed(res.data);
} }
} else if (res.data.resultCode != 1) { } else if (res.data.resultCode != 1) {
if (res.data.message != '') { if (res.data.message != '') {
...@@ -82,6 +79,50 @@ export default { ...@@ -82,6 +79,50 @@ export default {
} }
}); });
} }
//后台接口请求
Vue.prototype.requestAdmin = function(cmd, postMsg, success, failed) {
uni.request({
url: this.host2 + cmd,
method: "Post",
header: {
'content-type': "application/json"
},
data: {
MallBaseId: this.GetMiniAppId().MallBaseId,
TenantId: this.GetMiniAppId().TenantId,
msg: postMsg,
token: this.GetOpenId().AdminToken
},
success: res => {
if (res.data.resultCode == 10000) {
let u = uni.getStorageSync("mall_UserInfo");
if (u) {
this.getLogin_t(u)
}
} else if (res.data.resultCode != 1) {
if (res.data.message != '') {
uni.showToast({
title: res.data.message,
icon: "none",
});
}
typeof failed == "function" && failed(res.data);
} else {
typeof success == "function" && success(res.data);
}
},
fail: (e) => {
console.log("网络请求fail:" + JSON.stringify(e));
uni.showModal({
content: "" + res.errMsg
});
typeof failed == "function" && failed(res.data);
}
});
}
// token失效再次登录接口 // token失效再次登录接口
Vue.prototype.getLogin_t = function(obj) { Vue.prototype.getLogin_t = function(obj) {
let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0; let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
...@@ -120,7 +161,7 @@ export default { ...@@ -120,7 +161,7 @@ export default {
// 获取小程序APPID // 获取小程序APPID
Vue.prototype.GetMiniAppId = function() { Vue.prototype.GetMiniAppId = function() {
let appObj = {}; let appObj = {};
let appType = 1; let appType = 3;
switch (appType) { switch (appType) {
case 1: //赞羊 case 1: //赞羊
appObj = { appObj = {
...@@ -165,47 +206,47 @@ export default { ...@@ -165,47 +206,47 @@ export default {
}; };
break; break;
case 7: case 7:
appObj = {//韩国馆 appObj = { //韩国馆
AppId: 'wxbb033190e0ffa5db', AppId: 'wxbb033190e0ffa5db',
TenantId: 18, TenantId: 18,
MallBaseId: 8, MallBaseId: 8,
}; };
break; break;
case 8: case 8:
appObj = {//恋爱星球 appObj = { //恋爱星球
AppId: 'wx681f8ad58e6c48e4', AppId: 'wx681f8ad58e6c48e4',
TenantId: 21, TenantId: 21,
MallBaseId: 11, MallBaseId: 11,
}; };
break; break;
case 9: case 9:
appObj = {//罗演的杂货铺 appObj = { //罗演的杂货铺
AppId: 'wx67a8fb290ec58af4', AppId: 'wx67a8fb290ec58af4',
TenantId: 20, TenantId: 20,
MallBaseId: 10, MallBaseId: 10,
}; };
break; break;
case 10: case 10:
appObj = {//梅玲 appObj = { //梅玲
AppId: 'wx350f244458e5ba01', AppId: 'wx350f244458e5ba01',
TenantId: 22, TenantId: 22,
MallBaseId: 12, MallBaseId: 12,
}; };
break; break;
case 11: case 11:
appObj = {//星之旅 appObj = { //星之旅
AppId: 'wxa2c92313ece345f5', AppId: 'wxa2c92313ece345f5',
TenantId: 23, TenantId: 23,
MallBaseId: 13, MallBaseId: 13,
}; };
break; break;
case 12: case 12:
appObj = {//橙孀 appObj = { //橙孀
AppId: 'wx442f2a74b09d5f89', AppId: 'wx442f2a74b09d5f89',
TenantId: 24, TenantId: 24,
MallBaseId: 14, MallBaseId: 14,
}; };
break; break;
} }
return appObj; return appObj;
} }
...@@ -217,6 +258,7 @@ export default { ...@@ -217,6 +258,7 @@ export default {
UserId: 0, UserId: 0,
token: '', token: '',
SmallShopsId: 0, SmallShopsId: 0,
AdminToken: "", //后台Token
} }
if (mall_userinfo) { if (mall_userinfo) {
if (mall_userinfo.OpenId) { if (mall_userinfo.OpenId) {
...@@ -224,6 +266,7 @@ export default { ...@@ -224,6 +266,7 @@ export default {
obj.UserId = mall_userinfo.UserId; obj.UserId = mall_userinfo.UserId;
obj.token = mall_userinfo.Token; obj.token = mall_userinfo.Token;
obj.SmallShopsId = mall_userinfo.UserSmallShopId; obj.SmallShopsId = mall_userinfo.UserSmallShopId;
obj.AdminToken = mall_userinfo.AdminToken;
} }
} }
return obj return obj
...@@ -245,7 +288,6 @@ export default { ...@@ -245,7 +288,6 @@ export default {
val = Number(val).toFixed(2); val = Number(val).toFixed(2);
return val return val
} }
Vue.prototype.apiheader = function() { Vue.prototype.apiheader = function() {
return { return {
'X-Access-Token': '_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr', 'X-Access-Token': '_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr',
......
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