Browse Source

上传

master
前端-胡立永 4 months ago
parent
commit
6d62e111b5
23 changed files with 670 additions and 445 deletions
  1. +20
    -32
      api/api.js
  2. +2
    -3
      api/http.js
  3. +39
    -0
      api/model/login.js
  4. +24
    -6
      components/base/navbar.vue
  5. +1
    -1
      components/base/tabbar.vue
  6. +3
    -0
      components/config/configPopup.vue
  7. +17
    -11
      components/config/customerServicePopup.vue
  8. +4
    -0
      main.js
  9. +43
    -0
      mixins/configList.js
  10. +11
    -1
      pages/index/category.vue
  11. +2
    -2
      pages/index/center.vue
  12. +6
    -6
      pages_order/auth/wxLogin.vue
  13. +1
    -1
      pages_order/auth/wxUserInfo.vue
  14. +0
    -1
      pages_order/components/address/addressList.vue
  15. +61
    -18
      pages_order/mine/help.vue
  16. +346
    -350
      pages_order/order/refundsOrExchange.vue
  17. +22
    -2
      store/store.js
  18. +20
    -0
      uni.scss
  19. +18
    -1
      utils/index.js
  20. +6
    -6
      utils/oss-upload/oss/index.js
  21. +1
    -1
      utils/oss-upload/oss/web.js
  22. +2
    -2
      utils/position.js
  23. +21
    -1
      utils/utils.js

+ 20
- 32
api/api.js View File

@ -1,9 +1,12 @@
import http from './http.js' import http from './http.js'
import utils from '../utils/utils.js'
let limit = {} let limit = {}
let debounce = {} let debounce = {}
const models = []
const config = { const config = {
// 示例 // 示例
// wxLogin : {url : '/api/wxLogin', method : 'POST', // wxLogin : {url : '/api/wxLogin', method : 'POST',
@ -12,42 +15,14 @@ const config = {
// }, // },
getConfig : {url : '/api/getConfig', method : 'GET', limit : 500}, getConfig : {url : '/api/getConfig', method : 'GET', limit : 500},
// 微信登录接口
wxLogin: {
url: '/login/login',
method: 'POST',
limit : 500,
showLoading : true,
},
// 修改个人信息接口
updateInfo: {
url: '/info/updateInfo',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
//隐私政策
getPrivacyPolicy: {
url: '/login/getPrivacyPolicy',
method: 'GET',
},
//用户协议
getUserAgreement: {
url: '/login/getUserAgreement',
method: 'GET',
},
} }
export function api(key, data, callback, loadingTitle) { export function api(key, data, callback, loadingTitle) {
let req = config[key] let req = config[key]
if (!req) { if (!req) {
console.error('无效key' + key);
console.error('无效key--------' + key);
return return
} }
@ -73,9 +48,7 @@ export function api(key, data, callback, loadingTitle) {
//必须登录 //必须登录
if (req.auth) { if (req.auth) {
if (!uni.getStorageSync('token')) { if (!uni.getStorageSync('token')) {
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
utils.toLogin()
console.error('需要登录') console.error('需要登录')
return return
} }
@ -110,4 +83,19 @@ export function api(key, data, callback, loadingTitle) {
function addApiModel(model, key){
for(let k in model){
if(config[`${k}`]){
console.error(`重名api------model=${key},key=${k}`);
continue
}
config[`${k}`] = model[k]
// config[`${key}_${k}`] = model[k]
}
}
models.forEach(key => {
addApiModel(require(`./model/${key}.js`).default, key)
})
export default api export default api

+ 2
- 3
api/http.js View File

@ -1,5 +1,6 @@
import Vue from 'vue' import Vue from 'vue'
import utils from '../utils/utils.js'
function http(uri, data, callback, method = 'GET', showLoading, title) { function http(uri, data, callback, method = 'GET', showLoading, title) {
@ -29,9 +30,7 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
res.data.message == '操作失败,用户不存在!'){ res.data.message == '操作失败,用户不存在!'){
uni.removeStorageSync('token') uni.removeStorageSync('token')
console.error('登录过期'); console.error('登录过期');
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
utils.toLogin()
} }
if(res.statusCode == 200 && res.data.code != 200){ if(res.statusCode == 200 && res.data.code != 200){


+ 39
- 0
api/model/login.js View File

@ -0,0 +1,39 @@
// 登录相关接口
const api = {
// 微信登录接口
wxLogin: {
url: '/login_common/appletLogin',
method: 'GET',
limit : 500,
showLoading : true,
},
// 修改个人信息接口
updateInfo: {
url: '/info_common/updateInfo',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
// 获取个人信息
getInfo: {
url: '/info_common/getInfo',
method: 'GET',
auth: true,
},
//隐私政策
getPrivacyPolicy: {
url: '/login/getPrivacyPolicy',
method: 'GET',
},
//用户协议
getUserAgreement: {
url: '/login/getUserAgreement',
method: 'GET',
},
}
export default api

+ 24
- 6
components/base/navbar.vue View File

@ -2,27 +2,33 @@
<!-- <view class="navbar" <!-- <view class="navbar"
:style="{backgroundColor : bgColor}"> --> :style="{backgroundColor : bgColor}"> -->
<view class="title" <view class="title"
:style="{backgroundColor : bgColor}">
:style="{backgroundColor : bgColor,color}">
<view class="left"> <view class="left">
<uv-icon name="home"
v-if="leftClick && length == 1"
@click="toHome"
:color="color" size="46rpx"></uv-icon>
<uv-icon name="arrow-left" <uv-icon name="arrow-left"
v-if="leftClick"
v-else-if="leftClick"
@click="$emit('leftClick')" @click="$emit('leftClick')"
color="#333" size="46rpx"></uv-icon>
:color="color" size="46rpx"></uv-icon>
</view> </view>
<view>{{ title }}</view> <view>{{ title }}</view>
<view class="icon"> <view class="icon">
<uv-icon name="search" <uv-icon name="search"
v-if="isSearch" v-if="isSearch"
color="#333" size="58rpx"></uv-icon>
:color="color" size="58rpx"></uv-icon>
<uv-icon name="plus-circle" color="#333"
<uv-icon name="plus-circle" :color="color"
v-if="isPlus" v-if="isPlus"
@click="plusCircleShow = true" @click="plusCircleShow = true"
size="46rpx" style="margin-left: 30rpx;"></uv-icon> size="46rpx" style="margin-left: 30rpx;"></uv-icon>
<view v-if="moreClick" style="margin-left: 30rpx;"> <view v-if="moreClick" style="margin-left: 30rpx;">
<uv-icon name="more-dot-fill" color="#333"
<uv-icon name="more-dot-fill" :color="color"
v-if="!moreText" v-if="!moreText"
@click="moreClick()" @click="moreClick()"
size="46rpx"></uv-icon> size="46rpx"></uv-icon>
@ -64,6 +70,9 @@
}, },
bgColor : { bgColor : {
default : '#fff' default : '#fff'
},
color : {
default : '#333'
} }
}, },
created() { created() {
@ -72,9 +81,18 @@
}, },
data() { data() {
return { return {
length : getCurrentPages().length
}; };
}, },
methods : { methods : {
toHome(){
if(this.length != 1){
return
}
uni.reLaunch({
url: '/pages/index/index'
})
}
} }
} }
</script> </script>


+ 1
- 1
components/base/tabbar.vue View File

@ -72,7 +72,7 @@
if(index == this.select){ if(index == this.select){
return return
} }
uni.redirectTo({
uni.reLaunch({
url: item.pagePath url: item.pagePath
}) })
}, },


+ 3
- 0
components/config/configPopup.vue View File

@ -40,6 +40,9 @@
.configPopup { .configPopup {
.content{ .content{
padding: 30rpx 20rpx; padding: 30rpx 20rpx;
overflow: scroll;
height: 100%;
box-sizing: border-box;
} }
} }
</style> </style>

+ 17
- 11
components/config/customerServicePopup.vue View File

@ -1,10 +1,12 @@
<template> <template>
<!-- 联系客服弹框 --> <!-- 联系客服弹框 -->
<uv-overlay :show="show" @click="close">
<uv-popup ref="popup"
:safeAreaInsetBottom="false"
:round="30">
<view class="warp"> <view class="warp">
<view class="rect" @tap.stop> <view class="rect" @tap.stop>
<view class="title">联系客服</view>
<view class="center">确定拨打客服电话?</view>
<view class="title">联系{{ bTitle || title }}</view>
<view class="center">确定拨打{{ bTitle || title }}电话?</view>
<view class="bottom"> <view class="bottom">
<view class="btn1" <view class="btn1"
@click="close"> @click="close">
@ -17,18 +19,20 @@
</view> </view>
</view> </view>
</view> </view>
</uv-overlay>
</uv-popup>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
show: false,
phone:'', phone:'',
title : '客服',
bPhone : '',
bTitle : '',
} }
}, },
onLoad() {
mounted() {
this.getCustomPhone() this.getCustomPhone()
}, },
methods: { methods: {
@ -37,17 +41,19 @@
this.phone = res.result.phone this.phone = res.result.phone
}) })
}, },
open() {
this.show = true
open(phone, title) {
this.bPhone = phone || this.phone
this.bTitle = title || this.title
this.$refs.popup.open()
}, },
close() { close() {
this.show = false
this.$refs.popup.close()
}, },
// //
confirm() { confirm() {
this.show = false
this.$refs.popup.close()
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: this.phone,
phoneNumber: this.bPhone || this.phone,
success() { success() {
console.log('安卓拨打成功'); console.log('安卓拨打成功');
}, },


+ 4
- 0
main.js View File

@ -14,6 +14,10 @@ import store from '@/store/store'
import './config' import './config'
import './utils/index.js' import './utils/index.js'
import mixinConfigList from '@/mixins/configList.js'
Vue.mixin(mixinConfigList)
//组件注册 //组件注册
import configPopup from '@/components/config/configPopup.vue' import configPopup from '@/components/config/configPopup.vue'
import navbar from '@/components/base/navbar.vue' import navbar from '@/components/base/navbar.vue'


+ 43
- 0
mixins/configList.js View File

@ -0,0 +1,43 @@
import { mapState } from 'vuex'
export default {
data() {
return {
// 默认的全局分享内容
Gshare: {
// title: '三只青蛙',
path: '/pages/index/index', // 全局分享的路径,比如 首页
// imageUrl: '/static/image/login/logo.png', // 全局分享的图片(可本地可网络)
}
}
},
computed: {
...mapState(['configList', 'userInfo']),
},
// 定义全局分享
// 1.发送给朋友
onShareAppMessage(res) {
let o = {
...this.Gshare,
title : this.configList.logo_name,
}
if(this.userInfo.id){
o.path = this.Gshare.path + '?shareId=' + this.userInfo.id
}
return o
},
//2.分享到朋友圈
onShareTimeline(res) {
let o = {
...this.Gshare,
title : this.configList.logo_name,
}
if(this.userInfo.id){
o.path = this.Gshare.path + '?shareId=' + this.userInfo.id
}
return o
},
methods: {
}
}

+ 11
- 1
pages/index/category.vue View File

@ -115,10 +115,20 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.page{
/deep/ .uv-vtabs{
height: calc(100vh - 360rpx) !important;
}
/deep/ .uv-vtabs__bar{
height: calc(100vh - 360rpx) !important;
}
/deep/ .uv-vtabs__content{
height: calc(100vh - 360rpx) !important;
}
}
.category { .category {
font-size: 30rpx; font-size: 30rpx;
color: #333; color: #333;
min-height: 100vh;
.category-title{ .category-title{
position: relative; position: relative;
display: flex; display: flex;


+ 2
- 2
pages/index/center.vue View File

@ -18,9 +18,9 @@
今天是您来的的第32天 今天是您来的的第32天
</view> </view>
</view> </view>
<view class="headBtn" @click="headBtn">
<!-- <view class="headBtn" @click="headBtn">
角色切换 角色切换
</view>
</view> -->
<view class="setting"> <view class="setting">
<uv-icon name="setting" size="40rpx"></uv-icon> <uv-icon name="setting" size="40rpx"></uv-icon>
</view> </view>


+ 6
- 6
pages_order/auth/wxLogin.vue View File

@ -35,10 +35,10 @@
activeColor="#FD5100" activeColor="#FD5100"
:name="1" :name="1"
></uv-checkbox> ></uv-checkbox>
阅读并同意我们的<text @click="openConfigDetail('getPrivacyPolicy')">服务协议与隐私条款</text>
阅读并同意我们的<text @click="$refs.popup.open('getPrivacyPolicy')">服务协议与隐私条款</text>
</view> </view>
<view class=""> <view class="">
以及<text @click="openConfigDetail('getUserAgreement')">个人信息保护指引</text>
以及<text @click="$refs.popup.open('getUserAgreement')">个人信息保护指引</text>
</view> </view>
</view> </view>
</uv-checkbox-group> </uv-checkbox-group>
@ -50,7 +50,6 @@
</template> </template>
<script> <script>
import configPopup from '@/components/config/configPopup.vue';
export default { export default {
name : 'Login', name : 'Login',
data() { data() {
@ -93,8 +92,9 @@
background-color: #ddd; background-color: #ddd;
border-radius: 30rpx; border-radius: 30rpx;
image{ image{
width: 80rpx;
height: 80rpx;
height: 140rpx;
width: 140rpx;
border-radius: 30rpx;
} }
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
@ -142,7 +142,7 @@
.config{ .config{
position: absolute; position: absolute;
bottom: 0; bottom: 0;
font-size: 22rpx;
font-size: 24rpx;
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
text{ text{


+ 1
- 1
pages_order/auth/wxUserInfo.vue View File

@ -74,7 +74,7 @@
return return
} }
self.$api('infoUpdateInfo', self.userInfo, res => {
self.$api('updateInfo', self.userInfo, res => {
if (res.code == 200) { if (res.code == 200) {
uni.switchTab({ uni.switchTab({
url:'/pages/index/index' url:'/pages/index/index'


+ 0
- 1
pages_order/components/address/addressList.vue View File

@ -95,7 +95,6 @@
this.addressList = res.result.records || []; this.addressList = res.result.records || [];
this.total = res.result.total || 0; this.total = res.result.total || 0;
res.result.records.forEach(n => { // res.result.records.forEach(n => { //
console.log(n);
if (n.defaultFlag == 1) { if (n.defaultFlag == 1) {
this.selectAddress = n.id this.selectAddress = n.id
} }


+ 61
- 18
pages_order/mine/help.vue View File

@ -8,7 +8,7 @@
<text>问题和意见</text> <text>问题和意见</text>
<text style="color: #BD3624;">*</text> <text style="color: #BD3624;">*</text>
</view> </view>
<uv-textarea v-model="value" :count="true" border="none" height="400"
<uv-textarea v-model="form.question" :count="true" border="none" height="400"
placeholder="请把发现的问题提交给我们,感谢您的参与(必填)" placeholder="请把发现的问题提交给我们,感谢您的参与(必填)"
:text-style="{color:'#BCB7B7',fontSize:'28rpx'}" /> :text-style="{color:'#BCB7B7',fontSize:'28rpx'}" />
</view> </view>
@ -16,7 +16,7 @@
<view> <view>
<view class="help-issue"> <view class="help-issue">
<text>问题截图</text> <text>问题截图</text>
<text style="color: #BD3624;">*</text>
<!-- <text style="color: #BD3624;">*</text> -->
</view> </view>
<view class="help-screenshot"> <view class="help-screenshot">
@ -28,26 +28,27 @@
</view> </view>
</view> </view>
<!-- <view>
<view>
<view class="help-issue"> <view class="help-issue">
<text>联系方式</text> <text>联系方式</text>
<text style="color: #BD3624;">*</text> <text style="color: #BD3624;">*</text>
</view> </view>
<uv-input placeholder="请输入联系方式" fontSize="24rpx" border="bottom"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<uv-text text="联系姓名" size="24rpx" margin="20rpx 10rpx 20rpx 10rpx" />
</template>
</uv-input>
<uv-input placeholder="请输入联系姓名" border="none" fontSize="24rpx"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<uv-text text="联系方式" size="24rpx" margin="20rpx 10rpx 20rpx 10rpx" />
</template>
</uv-input>
</view> -->
<view class="form-sheet-cell">
<view>
联系姓名
</view>
<input placeholder="请输入联系姓名" v-model="form.name" />
</view>
<view class="form-sheet-cell">
<view>
联系电话
</view>
<input placeholder="请输入联系电话" v-model="form.phone" />
</view>
</view>
<view class="help-button"> <view class="help-button">
<view>确认</view>
<!-- <view>历史提交</view> -->
<view @click="submit">确认</view>
</view> </view>
</view> </view>
</view> </view>
@ -57,7 +58,12 @@
export default { export default {
data() { data() {
return { return {
value: "",
form : {
question : '',
phone : '',
name : '',
image : '',
},
fileList: [] fileList: []
} }
}, },
@ -78,6 +84,32 @@
}) })
}) })
}, },
submit(){
let data = JSON.parse(JSON.stringify(this.form))
if(this.$utils.verificationAll(this.form, {
question : '请输入你的问题和意见',//
// image : '',//
name : '请输入姓名',//
phone : '请输入手机号码',//
})){
return
}
data.image = this.fileList.map((item) => item.url).join(",")
this.$api('addAdvice', data, res => {
if(res.code == 200){
uni.showToast({
title: res.message,
icon:'none'
})
setTimeout(uni.navigateBack, 800, -1)
}
})
},
} }
} }
</script> </script>
@ -101,6 +133,17 @@
background-color: #fff; background-color: #fff;
padding: 20rpx; padding: 20rpx;
} }
.form-sheet-cell{
display: flex;
background-color: #fff;
padding: 20rpx 30rpx;
font-size: 24rpx;
align-items: center;
view{
width: 150rpx;
}
}
.help-button { .help-button {
display: flex; display: flex;


+ 346
- 350
pages_order/order/refundsOrExchange.vue View File

@ -1,360 +1,356 @@
<template> <template>
<view class="refundsOrExchange">
<navbar :title="title[titleIndex]" leftClick @leftClick="$utils.navigateBack"/>
<view class="frame">
<!-- 商品简介 -->
<view class="itme1" @click="openSpPopup">
<view class="left">
<img src="../../static/image/center/1.png" alt="" style="width: 100%;height: 100%;">
</view>
<view class="center">
<view>{{ commodity.title }}</view>
<view>{{ commodity.smallTitle }}</view>
</view>
<view class="right">×{{ commodity.total }}</view>
</view>
<!--<commoditySelect ></commoditySelect>-->
<!-- 申请类型&申请原因 -->
<view class="item2">
<view class="type">
<span>申请类型</span>
<span>退货退款</span>
</view>
<uv-line></uv-line>
<view class="reason">
<view>申请原因</view>
<view>
<uv-input placeholder="请输入申请原因" border="none" clearable></uv-input>
</view>
</view>
</view>
<!-- 退货数量&申请金额-->
<view class="item3">
<view class="type">
<span>{{ titleIndex == 0 ? '退货数量' : '换货数量' }}</span>
<span>
<view class="refundsOrExchange">
<navbar :title="title[titleIndex]" leftClick @leftClick="$utils.navigateBack" />
<view class="frame">
<!-- 商品简介 -->
<view class="itme1" @click="openSpPopup">
<view class="left">
<img src="../../static/image/center/1.png" alt="" style="width: 100%;height: 100%;">
</view>
<view class="center">
<view>{{ commodity.title }}</view>
<view>{{ commodity.smallTitle }}</view>
</view>
<view class="right">×{{ commodity.total }}</view>
</view>
<!--<commoditySelect ></commoditySelect>-->
<!-- 申请类型&申请原因 -->
<view class="item2">
<view class="type">
<span>申请类型</span>
<span>退货退款</span>
</view>
<uv-line></uv-line>
<view class="reason">
<view>申请原因</view>
<view>
<uv-input placeholder="请输入申请原因" border="none" clearable></uv-input>
</view>
</view>
</view>
<!-- 退货数量&申请金额-->
<view class="item3">
<view class="type">
<span>{{ titleIndex == 0 ? '退货数量' : '换货数量' }}</span>
<span>
<uv-number-box :min="1" :max="100"></uv-number-box> <uv-number-box :min="1" :max="100"></uv-number-box>
</span> </span>
</view>
<uv-line v-if='titleIndex == 0 ? true :false'></uv-line>
<view class="reason" v-if='titleIndex == 0 ? true :false'>
<view>申请原因</view>
<view>
<uv-input disabled placeholder="$" border="none" clearable></uv-input>
</view>
</view>
</view>
<!-- 申请说明 -->
<view class="item4">
<view>申请说明(选填)</view>
<view>
<uv-input placeholder="请您详细填写申请说明" border="none" clearable></uv-input>
</view>
<view>
<uv-upload :fileList="fileList" :maxCount="5" multiple width="150rpx" height="150rpx"
@delete="deleteImage" @afterRead="afterRead" :previewFullImage="true"></uv-upload>
</view>
</view>
<!-- 联系电话 -->
<view class="item5">
<view class="phone">
<view>联系电话</view>
<view>
<uv-input placeholder="请输入联系电话" border="none" clearable></uv-input>
</view>
</view>
</view>
</view>
<!-- 底部按钮 -->
<!--商品选择-->
<uv-popup ref="spPopup" :round="30">
<commoditySelect
:commodityList="commodityList"
@selectSp="selectCommodity"
/>
</uv-popup>
</view>
</view>
<uv-line v-if='titleIndex == 0 ? true :false'></uv-line>
<view class="reason" v-if='titleIndex == 0 ? true :false'>
<view>申请原因</view>
<view>
<uv-input disabled placeholder="$" border="none" clearable></uv-input>
</view>
</view>
</view>
<!-- 申请说明 -->
<view class="item4">
<view>申请说明(选填)</view>
<view>
<uv-input placeholder="请您详细填写申请说明" border="none" clearable></uv-input>
</view>
<view>
<uv-upload :fileList="fileList" :maxCount="5" multiple width="150rpx" height="150rpx"
@delete="deleteImage" @afterRead="afterRead" :previewFullImage="true"></uv-upload>
</view>
</view>
<!-- 联系电话 -->
<view class="item5">
<view class="phone">
<view>联系电话</view>
<view>
<uv-input placeholder="请输入联系电话" border="none" clearable></uv-input>
</view>
</view>
</view>
</view>
<!-- 底部按钮 -->
<!--商品选择-->
<uv-popup ref="spPopup" :round="30">
<commoditySelect :commodityList="commodityList" @selectSp="selectCommodity" />
</uv-popup>
</view>
</template> </template>
<script> <script>
import commoditySelect from "../components/commodity/commoditySelect.vue"
export default {
onLoad(option) {
this.titleIndex = option.index
},
components: {
commoditySelect
},
data() {
return {
titleIndex: 0,
title: ['申请换货', '申请退货'],
fileList: [],
bottomBtnStyle: {
color: '#FFF',
backgroundColor: '#fd5100',
fontSize: '34rpx',
text: '提交申请',
width: '400rpx',
height: '80rpx',
borderRadius: '100rpx',
bottom: '40rpx'
},
commodityList: [
{
title: '商品名称',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total:1,
},
{
title: '商品名称1',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total:1,
},
{
title: '商品名称2',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total:1,
}
],
commodity: {
title: '商品名称',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total:1,
},
}
},
mounted() {
},
methods: {
openSpPopup() {
this.$refs.spPopup.open('bottom');
},
// 退
selectCommodity(e) {
console.log(e, "selectCommodity--e")
this.commodity = e
this.$refs.spPopup.close()
},
confirm() {
console.log("===");
},
deleteImage(e) {
this.fileList.splice(e.index, 1)
},
afterRead(e) {
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
}
}
import commoditySelect from "../components/commodity/commoditySelect.vue"
export default {
onLoad(option) {
this.titleIndex = option.index
},
components: {
commoditySelect
},
data() {
return {
titleIndex: 0,
title: ['申请换货', '申请退货'],
fileList: [],
bottomBtnStyle: {
color: '#FFF',
backgroundColor: '#fd5100',
fontSize: '34rpx',
text: '提交申请',
width: '400rpx',
height: '80rpx',
borderRadius: '100rpx',
bottom: '40rpx'
},
commodityList: [{
title: '商品名称',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total: 1,
},
{
title: '商品名称1',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total: 1,
},
{
title: '商品名称2',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total: 1,
}
],
commodity: {
title: '商品名称',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total: 1,
},
}
},
mounted() {
},
methods: {
openSpPopup() {
this.$refs.spPopup.open('bottom');
},
// 退
selectCommodity(e) {
console.log(e, "selectCommodity--e")
this.commodity = e
this.$refs.spPopup.close()
},
confirm() {
console.log("===");
},
deleteImage(e) {
this.fileList.splice(e.index, 1)
},
afterRead(e) {
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
* {
box-sizing: border-box;
}
.refundsOrExchange {
.frame {
display: flex;
flex-direction: column;
gap: 30rpx;
width: 100%;
padding-top: 40rpx;
background-color: #f5f5f5;
.itme1 {
display: flex;
height: 200rpx;
background-color: #ffffff;
.left {
padding: 40rpx;
width: 20%;
border-radius: 10rpx;
background-color: #ffffff;
}
.center {
display: flex;
flex-direction: column;
justify-content: center;
gap: 20rpx;
width: 60%;
padding: 0rpx 0 0 20rpx;
background-color: #ffffff;
// view
> view:first-of-type {
font-size: 36rpx;
color: #333;
}
// view
> view:nth-of-type(2) {
font-size: 28rpx;
color: #666666;
}
}
.right {
display: flex;
justify-content: center;
align-items: center;
width: 10%;
color: #666666;
background-color: #ffffff;
}
}
.item2 {
width: 100vw;
.type {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
padding: 0 0 0 20rpx;
> span:nth-of-type(1) {
width: 30%;
}
> span:nth-of-type(2) {
width: 70%;
}
}
.reason {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
> view:nth-of-type(1) {
width: 30%;
}
> view:nth-of-type(2) {
width: 70%;
padding: 0 20rpx 0 0;
}
}
}
.item3 {
width: 100vw;
.type {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
padding: 0 0 0 20rpx;
> span:nth-of-type(1) {
width: 70%;
}
> span:nth-of-type(2) {
width: 30%;
}
}
.reason {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
> view:nth-of-type(1) {
width: 30%;
}
> view:nth-of-type(2) {
width: 70%;
padding: 0 20rpx 0 0;
}
}
}
.item4 {
display: flex;
flex-direction: column;
padding: 10rpx 0 0 20rpx;
background-color: #FFF;
> view:nth-of-type(1) {
background-color: #FFF;
}
> view:nth-of-type(2) {
margin: 10rpx 0 10rpx 0;
background-color: #FFF;
}
}
.item5 {
display: flex;
flex-direction: column;
padding: 0 0 0 20rpx;
background-color: #FFF;
.phone {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
> view:nth-of-type(1) {
width: 30%;
}
> view:nth-of-type(2) {
width: 70%;
padding: 0 20rpx 0 0;
}
}
}
}
}
* {
box-sizing: border-box;
}
.refundsOrExchange {
.frame {
display: flex;
flex-direction: column;
gap: 30rpx;
width: 100%;
padding-top: 40rpx;
background-color: #f5f5f5;
.itme1 {
display: flex;
height: 200rpx;
background-color: #ffffff;
.left {
padding: 40rpx;
width: 20%;
border-radius: 10rpx;
background-color: #ffffff;
}
.center {
display: flex;
flex-direction: column;
justify-content: center;
gap: 20rpx;
width: 60%;
padding: 0rpx 0 0 20rpx;
background-color: #ffffff;
// view
>view:first-of-type {
font-size: 36rpx;
color: #333;
}
// view
>view:nth-of-type(2) {
font-size: 28rpx;
color: #666666;
}
}
.right {
display: flex;
justify-content: center;
align-items: center;
width: 10%;
color: #666666;
background-color: #ffffff;
}
}
.item2 {
width: 100vw;
.type {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
padding: 0 0 0 20rpx;
>span:nth-of-type(1) {
width: 30%;
}
>span:nth-of-type(2) {
width: 70%;
}
}
.reason {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
>view:nth-of-type(1) {
width: 30%;
}
>view:nth-of-type(2) {
width: 70%;
padding: 0 20rpx 0 0;
}
}
}
.item3 {
width: 100vw;
.type {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
padding: 0 0 0 20rpx;
>span:nth-of-type(1) {
width: 70%;
}
>span:nth-of-type(2) {
width: 30%;
}
}
.reason {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
>view:nth-of-type(1) {
width: 30%;
}
>view:nth-of-type(2) {
width: 70%;
padding: 0 20rpx 0 0;
}
}
}
.item4 {
display: flex;
flex-direction: column;
padding: 10rpx 0 0 20rpx;
background-color: #FFF;
>view:nth-of-type(1) {
background-color: #FFF;
}
>view:nth-of-type(2) {
margin: 10rpx 0 10rpx 0;
background-color: #FFF;
}
}
.item5 {
display: flex;
flex-direction: column;
padding: 0 0 0 20rpx;
background-color: #FFF;
.phone {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
>view:nth-of-type(1) {
width: 30%;
}
>view:nth-of-type(2) {
width: 70%;
padding: 0 20rpx 0 0;
}
}
}
}
}
</style> </style>

+ 22
- 2
store/store.js View File

@ -8,7 +8,7 @@ import api from '@/api/api.js'
//Vuex.Store 构造器选项 //Vuex.Store 构造器选项
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
configList: [], //配置列表
configList: {}, //配置列表
shop : false, shop : false,
userInfo : {}, //用户信息 userInfo : {}, //用户信息
}, },
@ -24,6 +24,10 @@ const store = new Vuex.Store({
// api('getConfig', res => { // api('getConfig', res => {
// if(res.code == 200){ // if(res.code == 200){
// state.configList = res.result // state.configList = res.result
// res.result.forEach(n => {
// state.configList[n.keyName] = n.keyContent
// })
// } // }
// }) // })
@ -71,12 +75,28 @@ const store = new Vuex.Store({
}) })
}, },
getUserInfo(state){ getUserInfo(state){
api('infoGetInfo', res => {
api('getInfo', res => {
if(res.code == 200){ if(res.code == 200){
state.userInfo = res.result state.userInfo = res.result
} }
}) })
}, },
// 退出登录
logout(state){
uni.showModal({
title: '确认退出登录吗',
success(r) {
if(r.confirm){
state.userInfo = {}
state.role = false
uni.removeStorageSync('token')
uni.reLaunch({
url: '/pages/index/index'
})
}
}
})
},
}, },
actions: {}, actions: {},
}) })


+ 20
- 0
uni.scss View File

@ -74,3 +74,23 @@ $uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:26px; $uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色 $uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px; $uni-font-size-paragraph:15px;
.uni-color-btn{
border-radius: 40rpx;
padding: 20rpx;
margin: 40rpx;
background: $uni-color;
color: #fff;
text-align: center;
font-size: 28rpx;
}
.uni-uncolor-btn{
border-radius: 40rpx;
padding: 20rpx;
margin: 40rpx;
border: 1px solid $uni-color;
color: $uni-color;
text-align: center;
font-size: 28rpx;
}

+ 18
- 1
utils/index.js View File

@ -27,4 +27,21 @@ Vue.prototype.$dayjs = dayjs
Vue.prototype.$timeUtils = time Vue.prototype.$timeUtils = time
Vue.prototype.$utils = util Vue.prototype.$utils = util
Vue.prototype.$md5 = md5
Vue.prototype.$md5 = md5
Vue.prototype.previewImage = (urls, current) => {
uni.previewImage({
urls,
current,
})
}
Vue.prototype.openLocation = (latitude, longitude) => {
if(!latitude || !longitude){
return
}
uni.openLocation({
latitude : Number(latitude),
longitude : Number(longitude),
})
}

+ 6
- 6
utils/oss-upload/oss/index.js View File

@ -93,9 +93,9 @@ export function ossUploadImage({
count: 1, count: 1,
sizeType, sizeType,
success(res) { success(res) {
// #ifdef H5
return uploadFileToOSS(res.tempFiles[0]).then(success).catch(fail)
// #endif
// // #ifdef H5
// return uploadFileToOSS(res.tempFiles[0]).then(success).catch(fail)
// // #endif
ossUpload(res.tempFilePaths[0], key, folder).then(success).catch(fail) ossUpload(res.tempFilePaths[0], key, folder).then(success).catch(fail)
}, },
fail fail
@ -123,9 +123,9 @@ export function ossUploadVideo({
maxDuration, maxDuration,
camera, camera,
success(res) { success(res) {
// #ifdef H5
return uploadFileToOSS(res.tempFile).then(success).catch(fail)
// #endif
// // #ifdef H5
// return uploadFileToOSS(res.tempFile).then(success).catch(fail)
// // #endif
ossUpload(res.tempFilePath, key, folder).then(success).catch(fail) ossUpload(res.tempFilePath, key, folder).then(success).catch(fail)
}, },
fail fail


+ 1
- 1
utils/oss-upload/oss/web.js View File

@ -1,5 +1,5 @@
// 此方法适用于web // 此方法适用于web
import OSS from "ali-oss"
// import OSS from "ali-oss"
import config from '@/config.js' import config from '@/config.js'
/** /**


+ 2
- 2
utils/position.js View File

@ -144,8 +144,8 @@ function getUserAddressByIp(key) { //根据IP获取当前用户位置
//打开地图让用户选择位置 //打开地图让用户选择位置
function selectAddress(longitude, latitude, successCallback) { function selectAddress(longitude, latitude, successCallback) {
uni.chooseLocation({ uni.chooseLocation({
longitude, //经度
latitude, //纬度
// longitude, //经度
// latitude, //纬度
success: function(res) { success: function(res) {
successCallback && successCallback(res) successCallback && successCallback(res)
} }


+ 21
- 1
utils/utils.js View File

@ -144,6 +144,12 @@ export function copyText(content) {
}) })
} }
// 将字符串中的文本格式化html
export function stringFormatHtml(str){
return str && str.replace(/\n/gi, '<br>')
.replace(/ /gi, ' ')
}
function params(url){ function params(url){
if(typeof url == 'object'){ if(typeof url == 'object'){
return url return url
@ -172,6 +178,18 @@ export function navigateBack(num = -1){
export function redirectTo(...args){ export function redirectTo(...args){
uni.redirectTo(params(...args)) uni.redirectTo(params(...args))
} }
export const toLogin = function(){
let time = 0
return () => {
if(new Date().getTime() - time < 1000){
return
}
time = new Date().getTime()
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
}
}()
export default { export default {
toArray, toArray,
@ -185,5 +203,7 @@ export default {
navigateTo, navigateTo,
navigateBack, navigateBack,
redirectTo, redirectTo,
copyText
copyText,
stringFormatHtml,
toLogin
} }

Loading…
Cancel
Save