Browse Source

上传

hfll
前端-胡立永 3 months ago
parent
commit
8272afeeb7
10 changed files with 122 additions and 40 deletions
  1. +1
    -1
      components/couponPopup/couponPopup.vue
  2. +24
    -0
      components/user/productList.vue
  3. +4
    -4
      pages/index/center.vue
  4. +2
    -2
      pages/index/index.vue
  5. +23
    -8
      pages_order/components/product/submit.vue
  6. +3
    -22
      pages_order/mine/promotion.vue
  7. +8
    -2
      pages_order/order/orderDetail.vue
  8. +1
    -1
      uni.scss
  9. +53
    -0
      utils/authorize.js
  10. +3
    -0
      utils/index.js

+ 1
- 1
components/couponPopup/couponPopup.vue View File

@ -8,7 +8,7 @@
<view class="main-container"
@click="toCoupon">
<view class="body">
<image :src="configList.wx_image" mode="widthFix" class="coupon-bg"></image>
<image :src="configList.coupon_image" mode="widthFix" class="coupon-bg"></image>
<image @click.stop="close" src="@/static/image/coupon/close-btn.png" mode="widthFix"
class="close-btn">
</image>


+ 24
- 0
components/user/productList.vue View File

@ -8,6 +8,15 @@
<view class="product-title">
{{ item.title }}
</view>
<view class="tag-list">
<view class="tag"
:key="i"
v-for="(t, i) in item.skuIcon
&& item.skuIcon.split(',')">
{{ t }}
</view>
</view>
<view class="product-main">
<view class="sale-information">
@ -88,6 +97,21 @@
height: 250rpx;
border-radius: 20rpx;
}
.tag-list{
display: flex;
flex-wrap: wrap;
padding: 6rpx 0;
.tag{
padding: 6rpx 12rpx;
border-radius: 14rpx;
background-color: rgba($uni-color, 0.1);
color: $uni-color;
border: 1rpx solid $uni-color;
font-size: 20rpx;
margin: 6rpx;
}
}
.product-info {
font-size: 24rpx;


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

@ -103,7 +103,7 @@
<image src="@/static/image/center/2.png" mode="widthFix" />
<view class="title">我的团队</view>
</view>
<view class="boxs" @click="$refs.customerServicePopup.open()">
<view class="boxs" @click="$utils.navigateTo('/pages_order/home/contact')">
<image src="@/static/image/center/3.png" mode="widthFix" />
<view class="title">联系客服</view>
</view>
@ -145,7 +145,7 @@
</view>
<!-- 广告 -->
<div v-if="showAdvertising" class="ad">
<!-- <div v-if="showAdvertising" class="ad">
<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="true" :interval="2000"
:duration="duration">
<swiper-item v-for="(item, index) in adList" :key="index">
@ -160,7 +160,7 @@
</view>
</swiper-item>
</swiper>
</div>
</div> -->
<customerServicePopup ref="customerServicePopup" />
@ -414,7 +414,7 @@
.money {
font-size: 40rpx;
color: #DC2828;
color: $uni-color;
font-weight: bold;
}
}


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

@ -3,7 +3,7 @@
<view style="background-color: white;">
<!-- 导航栏 -->
<navbar />
<navbar :title="configList.logo_name"/>
<!-- 搜索栏 -->
<view class="search">
@ -320,7 +320,7 @@
.new-perple-top-left {
display: flex;
align-items: center;
color: #E7474C;
color: $uni-color;
.title {
font-size: 40rpx;


+ 23
- 8
pages_order/components/product/submit.vue View File

@ -1,20 +1,29 @@
<template>
<view class="submit">
<!-- 联系客服 -->
<view @click="$emit('service')" class="service-icon">
<!-- <view @click="$emit('service')" class="service-icon">
<image src="@/pages_order/static/productDetail/service.png" mode="widthFix" class="service-icon-img">
</image>
<view class="title">
客服
</view>
</view>
</view> -->
<button
open-type="contact"
class="service-icon">
<image src="@/pages_order/static/productDetail/service.png" mode="widthFix" class="service-icon-img">
</image>
<view class="title">
客服
</view>
</button>
<view class="submit-btn">
<!-- <view class="l"s
v-if="detail.type == 2"
@click="$emit('addCart')">
加入购物车
</view> -->
<view class="l"
@click="$emit('toSend')">
我要送礼
</view>
<view class="r" @click="$emit('submit')">
{{ submiitTitle }}
</view>
@ -62,9 +71,15 @@
//
.service-icon {
padding: 0;
margin: 0;
background-color: transparent;
display: flex;
flex-direction: column;
justify-content: center;
&::after{
border: 0;
}
.service-icon-img {
width: 45rpx;
@ -88,7 +103,7 @@
justify-content: center;
align-items: center;
overflow: hidden;
border: 1rpx solid $uni-color;
.l {
flex: 1;
display: flex;


+ 3
- 22
pages_order/mine/promotion.vue View File

@ -141,28 +141,9 @@
back() {
uni.navigateBack(-1)
},
preservationImg(img) {
let that = this
uni.authorize({
/* scope.writePhotosAlbum 类型是保存到相册 */
scope: 'scope.writePhotosAlbum',
success() {
/* 已授权进入 */
/* 保存图片到相册方法方法 */
that.imgApi(img);
},
complete(res) {
/* 判断如果没有授权就打开设置选项让用户重新授权 */
uni.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
/* 打开设置的方法 */
that.openInstall();
}
}
});
}
});
async preservationImg(img) {
await this.$authorize('scope.writePhotosAlbum')
this.imgApi(img);
},
imgApi(image) {
/* 获取图片的信息 */


+ 8
- 2
pages_order/order/orderDetail.vue View File

@ -184,9 +184,9 @@
{{ order.orderDetails }}
</view>
<view class="btns">
<view @click="$refs.customerServicePopup.open()" class="btn">
<button open-type="contact" class="btn">
联系客服
</view>
</button>
</view>
</view>
@ -620,6 +620,12 @@
border: 1px solid #A9A7A7;
padding: 10rpx 20rpx;
border-radius: 30rpx;
background-color: transparent;
font-size: 24rpx;
margin: 0;
&::after{
border: 0;
}
}
}
}

+ 1
- 1
uni.scss View File

@ -12,7 +12,7 @@
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量同时无需 import 这个文件
*/
/* 颜色变量 */
$uni-color: #E3441A;
$uni-color: rgb(235, 51, 0);
/* 行为相关颜色 */
$uni-color-primary: #007aff;


+ 53
- 0
utils/authorize.js View File

@ -0,0 +1,53 @@
function authorize(scope){
return new Promise((success, error) => {
uni.authorize({
/* scope.writePhotosAlbum 类型是保存到相册 */
scope,
success,
complete(res) {
/* 判断如果没有授权就打开设置选项让用户重新授权 */
uni.getSetting({
success(res) {
if (!res.authSetting[scope]) {
setting()
}
}
});
}
});
function setting(){
uni.showModal({
title: '当前操作未授权,请授权!',
content: '拒绝授权将影响本小程序部分功能的使用',
confirmText: '授权',
success(e) {
if(!e.confirm){
return error()
}
uni.openSetting({
success(res) {
if (!res.authSetting[scope]) {
uni.showToast({
title: '授权失败',
icon: 'none',
})
return error()
}
success()
}
});
}
})
}
})
}
export default authorize

+ 3
- 0
utils/index.js View File

@ -3,6 +3,8 @@ import Vue from 'vue'
import util from './utils.js'
import time from './timeUtils.js'
import authorize from './authorize.js'
import 'dayjs/locale/zh-cn'
import dayjs from 'dayjs'
@ -24,6 +26,7 @@ import { handleTree } from './tree.js'
Vue.prototype.$handleTree = handleTree
Vue.prototype.$Oss = Oss
Vue.prototype.$dayjs = dayjs
Vue.prototype.$authorize = authorize
Vue.prototype.$timeUtils = time
Vue.prototype.$utils = util


Loading…
Cancel
Save