更新优惠券领取

This commit is contained in:
zhangmanman
2021-09-18 14:04:18 +08:00
160 changed files with 27053 additions and 2018 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
unpackage

View File

@@ -14,6 +14,10 @@
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]

5
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

12
.idea/barter-app(new-app).iml generated Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/barter-appnew-app.iml" filepath="$PROJECT_DIR$/.idea/barter-appnew-app.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

15
App.vue
View File

@@ -5,19 +5,20 @@
},
onShow () {
console.log('App Show')
uni.hideLoading()
},
onHide () {
console.log('App Hide')
},
globalData: {
mainColor: "white"
}
},
globalData: {
mainColor: "white"
}
}
</script>
<style lang="scss">
@import "uview-ui/index.scss";
page{
background: #f5f5f5;
page{
background: #f5f5f5;
}
</style>
</style>

View File

@@ -33,7 +33,7 @@ const getCouponsInfoById = (id) => {
// 根据企业id获取企业首页的轮播图列表
const couponsByCompanyId = (data) => {
return request({
url: 'coupons',
url: 'coupons/all',
method: 'get',
data: data
})

View File

@@ -55,7 +55,7 @@ const managesGoodsBurn = data => {
})
}
// 商品管理-商品上架
// 商品管理-商品上架 ********已废弃
const managesGoodsOnsale = id => {
return request({
url: 'manages/goods/'+id+'/onsale',
@@ -63,7 +63,7 @@ const managesGoodsOnsale = id => {
})
}
// 商品管理-商品下架
// 商品管理-商品下架 ********已废弃
const managesGoodsOffsale = id => {
return request({
url: 'manages/goods/'+id+'/offsale',
@@ -71,7 +71,7 @@ const managesGoodsOffsale = id => {
})
}
// 发布商品前置 manages/goods/create
// 发布商品前置
const managesGoodsCreateBefore = () => {
return request({
url: 'manages/goods/create'
@@ -100,7 +100,31 @@ const managesCreate = (data) => {
url: 'manages/goods/create',
data
})
}
}
// 商品认证
const managesGoodsAuth = (id, data) => {
return request({
url: 'manages/goods/' + id + '/extends',
method:'POST',
data
})
}
// 商品删除
const managesGoodsDelete = id => {
return request({
url: 'manages/goods/' + id,
method:'DELETE'
})
}
// 产品信息
const managesGoodsEdit = id => {
return request({
url: 'manages/goods/' + id
})
}
// 区块链证书
const managesChain = (id) => {
@@ -129,8 +153,24 @@ const managesCoupons = (id) => {
url: 'coupons/'+ id +'/grant',
method: 'POST'
})
}
}
// 产品编辑
const managesGoodsPut = (id, data) => {
return request({
url: 'manages/goods/' + id,
method: 'PUT',
data
})
}
// 产品附加信息
const managesGoodsExtends = id => {
return request({
url: 'manages/goods/' + id + '/extends',
})
}
export {
mall,
list,
@@ -143,9 +183,14 @@ export {
managesGoodsCreateBefore,
managesGoodsCreate,
managesCategory,
managesGoodsAuth,
managesGoodsDelete,
managesGoodsEdit,
managesCreate,
managesChain,
managesAttestation,
managesTracedTo,
managesCoupons
managesCoupons,
managesGoodsPut,
managesGoodsExtends
}

58
apis/interfaces/market.js Normal file
View File

@@ -0,0 +1,58 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 转让市场
*/
import { request } from '../index'
// 转让市场
const markets = data => {
return request({
url: 'markets',
data
})
}
// 转让市场记录
const marketsLogs = data => {
return request({
url: 'markets/orders',
data
})
}
// 转让详情
const marketsInfo = id => {
return request({
url: 'markets/' + id
})
}
// 提交支付订单
const marketsBuy = (id, data) => {
return request({
url: 'markets/' + id + '/create',
method: 'POST',
data
})
}
// 转让市场支付
const marketsPay = (id, platform) => {
return request({
url: 'markets/pay/' + id + '/' + platform
})
}
//
export {
markets,
marketsLogs,
marketsInfo,
marketsBuy,
marketsPay
}

97
apis/interfaces/mine.js Normal file
View File

@@ -0,0 +1,97 @@
/**
* Web-zdx
* moduleName:个人中心相关操作
*/
import request from '../request.js'
// 关注店铺
const shopSubscribe = (id) => {
return request({
url: 'mall/shops/subscribe/' + id,
method: 'POST'
})
}
// 我的关注店铺列表
const shopSubscribeList = (page) => {
return request({
url: 'mall/shops/subscribe',
method:'get',
data:{
page:page
}
})
}
// 关于我们
const aboutUs = () => {
return request({
url: 'articles/about'
})
}
// 获取用户信息
const getUserInfo = () => {
return request({
url: 'user/app'
})
}
// 获取用户设置中心的信息
const getUserSettingInfo = () => {
return request({
url: 'user/setting'
})
}
// 账号余额等信息
const chaineb = (data) => {
return request({
url: 'user/account/chaineb',
method:'get',
data:data
})
}
// 我的足迹
const browsers = (page) => {
return request({
url: 'mall/goods/browsers',
method: 'get',
data: {
page:page,
page_size:20
}
})
}
// 修改用户头像或昵称
const resetUserInfo= (data) => {
return request({
url: 'user/'+data.key,
method: 'PUT',
data:{
value:data.value
}
})
}
// 我的推广码
const appcode = () => {
return request({
url: 'user/appcode'
})
}
export {
shopSubscribe,
shopSubscribeList,
aboutUs,
getUserInfo,
getUserSettingInfo,
chaineb,
browsers,
resetUserInfo,
appcode
}

View File

@@ -13,6 +13,7 @@ const mallWarrants = (data) => {
data: data
})
}
// 我的数权Id获取数权详情
const mallWarrantsList = (symbol) => {
return request({
@@ -23,6 +24,7 @@ const mallWarrantsList = (symbol) => {
}
})
}
// 确认提货
const mallWarrantsSure = (data) => {
return request({
@@ -31,6 +33,7 @@ const mallWarrantsSure = (data) => {
data: data
})
}
// 我的邮寄订单,我的提货单
const mallShipmentsPostShop = (apiUrl,data) => {
return request({
@@ -39,6 +42,7 @@ const mallShipmentsPostShop = (apiUrl,data) => {
data: data
})
}
// 根据提货单的no 获取提货单的详情
const mallShipmentsInfo = (no) => {
return request({
@@ -46,6 +50,7 @@ const mallShipmentsInfo = (no) => {
method: 'GET'
})
}
// 取消提货单
const mallShipmentsCancel = (shipmentNo) => {
return request({
@@ -103,6 +108,7 @@ const mallRefundsInfo = (no) => {
method: 'GET'
})
}
// 确认退货mall/refunds/{refund}/deliver
const mallRefundsDeliver = (data) => {
return request({

22
apis/interfaces/scan.js Normal file
View File

@@ -0,0 +1,22 @@
/**
* Web-zdx
* moduleName:核销相关操作
*/
import request from '../request.js'
// 扫码前置条件
const scanInfo = (apiUrl,data,method) => {
return request({
url: apiUrl,
method:method,
data:data
})
}
export {
scanInfo
}

View File

@@ -21,20 +21,18 @@
<view class="coupon-right-des" v-if='item.type.value === 2'>{{item.price_text}}</view>
<view class="coupon-right-day">剩余{{item.time.expire}}</view>
</view>
<view class="coupon-to-used" @click="$router.push({name:'CouponDetail',query:{id:item.coupon_grant_id}})">
去使用
</view>
<view class="coupon-to-used" @click="couponDetailGo(item.coupon_grant_id)"> 去使用 </view>
</view>
</view>
<view class="check-all" v-if="item.coupon_count>2" @click="$router.push({name:'CouponMoreList', query:{id:item.coupon_id}})">
<view class="check-all" v-if="item.coupon_count>2" @click="couponMoreListGo(item.coupon_id)">
查看全部{{item.coupon_count}}张优惠券 <uni-icons type="arrowright" size="16" color="#cacaca"></uni-icons>
</view>
<!-- 已使用未使用标识 -->
<image class="used" v-if='item.status.status === 2' src="/static/images/has_used.png" mode="widthFix" />
<image class="used" v-if="item.status.status === 3" src="/static/images/has_un_used.png" mode="widthFix" />
<view class="has-used-bg" v-if="item.status.status === 2 || item.status.status === 3"></view>
<!-- <view class="has-used-bg" v-if="item.status.status === 2 || item.status.status === 3"></view> -->
</view>
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
@@ -54,11 +52,26 @@
return {
};
},
methods:{
couponDetailGo(id) {
// this.$router.push({name: 'CouponDetail', query: {id: id}})
uni.navigateTo({
url:'/pages/property/coupon/detail?id='+id
})
},
couponMoreListGo(id) {
// this.$router.push({name:'CouponMoreList', query:{id: id}})
uni.navigateTo({
url: '/pages/property/coupon/couponMore?id='+id
})
}
}
}
</script>
<style lang="scss" scoped>
$padding:20rpx;
.coupon-item {
margin: $padding $padding;
position: relative;

View File

@@ -17,7 +17,7 @@
<view class="name1 ellipsis-2">{{item.goods_sku.goods_name}}</view>
<!-- <span>{{item.account.balance}}</span> -->
</view>
<view class="sku">权个数 <span>x {{item.qty}}</span> </view>
<view class="sku">个数 <span>x {{item.qty}}</span> </view>
<!-- <view class="sku">提货方式 <span> {{item.type_text}}</span> </view> -->
</view>
</view>

View File

@@ -18,8 +18,9 @@
<view class="name1 ellipsis-2">{{item.goods_sku.goods_name}}</view>
<!-- <span>{{item.account.balance}}</span> -->
</view>
<view class="sku">权个数 <span>x {{item.qty}}</span> </view>
<view class="sku">提货方式 <span> {{item.type_text}}</span> </view>
<view class="sku">个数 <span>x {{item.qty}}</span> </view>
<view class="sku" v-if="item.goods_type === 2">使用方式 <span> 门店使用</span> </view>
<view class="sku" v-else>提货方式 <span> {{item.type_text}}</span> </view>
</view>
</view>
</view>

View File

@@ -18,7 +18,7 @@
<view class="name1 ellipsis-2">{{item.goods.goods_name}}</view>
<!-- <span>{{item.account.balance}}</span> -->
</view>
<view class="sku">权个数 <span>x {{item.account.balance}}</span> </view>
<view class="sku">个数 <span>x {{item.account.balance}}</span> </view>
</view>
</view>
</view>

View File

@@ -112,6 +112,15 @@
"navigationBarBackgroundColor": "#e93340"
}
},
{
"path": "pages/property/coupon/canUseList",
"name": "CanUseList",
"style": {
"navigationBarTitleText": "可兑换商品列表",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#039bfe"
}
},
{
"path": "pages/property/coupon/coupon",
"name": "CouponList",
@@ -139,6 +148,70 @@
"navigationBarBackgroundColor": "#e93340",
"navigationBarTitleText": "优惠券详情"
}
},{
"path": "pages/property/collection/collection",
"name": "Collection",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#e93340",
"navigationBarTitleText": "收藏的企业"
}
},{
"path": "pages/property/historyShop/historyShop",
"name": "HistoryShop",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#e93340",
"navigationBarTitleText": "我的足迹"
}
},{
"path": "pages/property/order/servicesOrder",
"name": "ServicesOrder",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#e93340",
"navigationBarTitleText": "已使用订单"
}
},{
"path": "pages/property/order/servicesOrderInfo",
"name": "ServicesOrderInfo",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#e93340",
"navigationBarTitleText": "订单详情"
}
},{
"path": "pages/property/setting/setting",
"name": "Setting",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#e93340",
"navigationBarTitleText": "设置中心"
}
},{
"path": "pages/property/eb",
"name": "Eb",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#f40c50",
"navigationBarTitleText": "我的EB"
}
},
{
"path": "pages/property/record",
"name": "Record",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#f40c50",
"navigationBarTitleText": "我的零钱"
}
},
{
"path": "pages/goods/details",
@@ -214,7 +287,8 @@
"path": "pages/market/logs",
"name": "marketLogs",
"style": {
"navigationBarTitleText": "成交历史"
"navigationBarTitleText": "成交历史",
"navigationBarBackgroundColor":"#FFFFFF"
}
}, {
"path": "pages/order/buy",
@@ -355,6 +429,16 @@
"navigationBarTitleText": "优惠券"
}
}, {
"path": "pages/coupons/couponList",
"name": "Coupons",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"backgroundColor": "#e93340"
}
},
{
"path": "pages/coupons/management",
"name": "CouponsMag",
"style": {
@@ -393,13 +477,17 @@
"path": "pages/verification/index",
"name": "Verification",
"style": {
"navigationBarTitleText": "扫码验证"
"navigationBarTitleText": "扫码验证",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#039bfe"
}
}, {
"path": "pages/verification/details",
"name": "VerificationDetails",
"style": {
"navigationBarTitleText": "核销券详情"
"navigationBarTitleText": "核销券详情",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#f40c50"
}
}, {
"path": "pages/shop/lists",
@@ -423,8 +511,31 @@
"navigationBarTitleText": "创建门店/部门",
"navigationBarBackgroundColor": "#FFFFFF"
}
}
],
}, {
"path": "pages/goods/goodsAuth",
"name": "goodsAuth",
"style": {
"navigationBarTitleText": "商品认证信息",
"navigationBarBackgroundColor": "#FFFFFF"
}
}, {
"path" : "pages/market/details",
"name" : "marketDetails",
"style" : {
"navigationBarTitleText": "转让详情"
}
},{
"path" : "pages/market/goods",
"name" : "marketGoods",
"style": {
"navigationBarTitleText": "锚定商品",
"titleNView": {
"backgroundColor": "#FFFFFF",
"type": "transparent"
}
}
}
],
"tabBar": {
"color": "#bababa",
"selectedColor": "#e93340",

File diff suppressed because one or more lines are too long

View File

@@ -142,7 +142,7 @@
<view class="title">
限时抢购<text>海量商家优惠券</text>
</view>
<navigator class="more" url="#">查看更多</navigator>
<navigator class="more" url="/pages/coupons/couponList">查看更多</navigator>
</view>
<view class="coupons" v-if="coupons.length > 0">
<view class="coupons-item" v-for="(item, index) in coupons" :key="index">

View File

@@ -23,7 +23,7 @@
<!-- 商品基本信息 -->
<view class="form-block">
<view class="form-box inputs-flex">
<label class="form-label">品标题</label>
<label class="form-label">品标题</label>
<input type="text" v-model="name" placeholder="输入商品标题"/>
</view>
<view class="form-box inputs-flex">
@@ -32,7 +32,7 @@
</view>
<view class="form-box inputs-flex">
<label class="form-label">规格单位</label>
<input type="digit" :value="skus_unit" placeholder="输入规格单位 如:件"/>
<input type="text" v-model="skus_unit" placeholder="输入规格单位 如:件"/>
</view>
<view class="form-upd">
<view class="form-title">商品详情点击预览长按删除</view>
@@ -72,98 +72,217 @@
</view>
<!-- 商品详情介绍 -->
<view class="form-block">
<!-- is_change query 0 是否支持易货 -->
<view class="form-box inputs-flex">
<label class="form-label">易货起购数量</label>
<input type="number" v-model="skus_number" placeholder="输入易货起购数量"/>
<view class="form-box picker-flex">
<label class="form-label">支持易货</label>
<view class="picker-switch">
<switch :checked="isChange" color="#e93340" @change="pickerChange($event, 'isChange')"/>
</view>
</view>
<view class="form-box inputs-flex" v-if="isChange">
<label class="form-label">最低易货量</label>
<input type="number" v-model="skus_number" placeholder="输入最低易货量"/>
</view>
<view class="form-box inputs-flex">
<label class="form-label">商品库存</label>
<input type="number" v-model="skus_stock" placeholder="输入商品库存"/>
<label class="form-label">发行权证数</label>
<input type="number" v-model="skus_stock" placeholder="输入商品发行权证数"/>
</view>
</view>
<!-- 售后服务 -->
<view class="form-block">
<view class="form-box picker-flex">
<label class="form-label">配送方式</label>
<view class="picker-text">
logistic_type 1.快递2.自提<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view>
<picker :range="logisticArr" range-key="text" :value="logisticType" @change="pickerChange($event, 'logisticType')">
<view class="picker-text">
{{logisticArr[logisticType].text}}
<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view>
</picker>
</view>
<view class="form-box picker-flex">
<view class="form-box picker-flex" v-if="logisticType === 1">
<label class="form-label">关联店铺</label>
<view class="picker-text">
stores 自提必填<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
<view class="picker-text" @click="opnePopup('storePopup')">
已关联{{stores.length}}家店铺<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view>
</view>
<view class="form-box picker-flex">
<label class="form-label">允许售后</label>
<view class="picker-switch">
<switch :checked="isPostSale" color="#e93340" @change="pickerChange($event, 'isPostSale')"/>
</view>
</view>
<view class="form-box picker-flex">
<label class="form-label">可选服务</label>
<view class="picker-text">
321321<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
<view class="picker-text" @click="opnePopup('categoryPopup')">
已选{{services.length}}项服务<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view>
</view>
</view>
<!-- 售后服务 -->
<view class="form-block">
<view class="form-block" v-if="type == 2">
<view class="form-box picker-flex">
<label class="form-label">到期时间</label>
<view class="picker-text">
321321<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view>
<picker mode="date" :value="expiriedAt" @change="pickerChange($event, 'expiriedAt')">
<view class="picker-text">
{{expiriedAt || '选择服务到期时间'}}
<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view>
</picker>
</view>
</view>
<!-- 可选服务 -->
<uni-popup ref="categoryPopup">
<view class="category-popup">
<view class="header">
<view class="title">选择商品服务</view>
</view>
<view class="category-flex">
<view class="category-flex-item" :class="{'show' : item.check}" v-for="(item, index) in servicesArr" :key="index" @click="item.check = !item.check">
<view class="category-name">{{item.name}}</view>
<view class="category-content">{{item.content}}</view>
</view>
</view>
<view class="btns">
<button type="default" size="default" @click="affirmCategory('services', 'categoryPopup')">确定</button>
</view>
</view>
</uni-popup>
<!-- 选择店铺 -->
<uni-popup ref="storePopup">
<view class="category-popup">
<view class="header">
<view class="title">选择店铺</view>
</view>
<view class="category-flex">
<view class="category-flex-item" :class="{'show' : item.check}" v-for="(item, index) in storesArr" :key="index" @click="item.check = !item.check">
<view class="category-name">{{item.name}}</view>
<view class="category-content">{{item.address}}</view>
</view>
</view>
<view class="btns">
<button type="default" size="default" @click="affirmCategory('stores', 'storePopup')">确定</button>
</view>
</view>
</uni-popup>
<!-- 安全区 -->
<view class="ios-bottom"></view>
<!-- footer -->
<view class="footer">
<button class="footer-btn" type="default">发布</button>
<button class="footer-btn" type="default" @click="submitAdd">{{type == 2 ? '发布': '发布并认证'}}</button>
<view class="ios-bottom"></view>
</view>
</view>
</template>
<script>
import { managesGoodsCreate, managesCreate } from '@/apis/interfaces/goods'
import { managesGoodsCreate, managesCreate, managesGoodsEdit, managesGoodsPut } from '@/apis/interfaces/goods'
import { uploads } from '@/apis/interfaces/uploading'
export default {
data() {
return {
categoryId : '', // 一级分类
categoryCid : '', // 二级分类
name : '', // 标题
pictures : [], // 轮播图
content : [], // 详情图
description : '', // 商品描述
isPostSale : false, // 是否允许售后
services : [], // 商品服务
skus_cost : '0.00',// 市场价格
skus_price : '0.00',// 销售价格
skus_cost : '', // 市场价格
skus_price : '', // 销售价格
skus_number : 1, // 易货起购数量
skus_unit : '件', // 规格文字
skus_charge : '0.00',// 分销佣金
skus_stock : 0, // 库存
skus_charge : '', // 分销佣金
skus_stock : '', // 库存
isChange : false, // 是否支持易货
logisticType: 0, // 配送方式
stores : [], // 关联店铺
expiriedAt : '', // 活动到期时间
logisticType: 0, // 配送方式
logisticArr : [
{text: '快递', type: 1},
{text: '自提', type: 2}
],
// 配置信息
storesArr : [], // 可选店铺
tags : [], // 可选商品标签
tagsIndex : 0, // 选择标签的下标
servicesArr : [], // 可选服务
type : 1, // 1为商品0为服务
type : 1, // 1为商品2为服务
};
},
created() {
// 编辑状态信息
if(this.$Route.query.type && this.$Route.query.type === 'edit'){
managesGoodsEdit(this.$Route.query.id).then(res => {
let services = [], stores = []
let servicesArr = res.services.map(val => {
let check = (res.data.services.findIndex(obj => obj.service_id === val.service_id)) >= 0
if(check){
services.push(val.service_id)
}
return{
check,
...val
}
})
let storesArr = res.stores.map(val => {
let check = (res.data.stores.findIndex(obj => obj.store_id === val.store_id)) >= 0
if(check){
stores.push(val.store_id)
}
return {
check,
...val
}
})
this.categoryId = res.data.category.category_id
this.categoryCid = res.data.category_sub.category_id
this.name = res.data.name
this.content = res.data.content
this.description = res.data.description
this.pictures = res.data.pictures
this.skus_cost = res.data.skus[0].cost
this.skus_price = res.data.skus[0].price
this.skus_number = res.data.skus[0].number
this.skus_unit = res.data.skus[0].unit
this.skus_charge = res.data.skus[0].charge
this.skus_stock = res.data.skus[0].stock
this.isPostSale = res.data.is_post_sale == 0
this.isChange = res.data.is_change == 0
this.logisticType= this.logisticArr.findIndex(val => val.type === res.data.logistic_type)
this.servicesArr = servicesArr
this.storesArr = storesArr
this.services = services
this.stores = stores
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
return
}
// 添加配置信息
managesCreate({
category_cid: 140
category_cid: this.$Route.query.cid
}).then(res => {
res.services = res.services.map(val => {
return {
check: false,
...val
}
})
res.stores = res.stores.map(val => {
return {
check: false,
...val
}
})
this.storesArr = res.stores
this.tags = res.tags
this.servicesArr= res.services
this.type = res.type
this.categoryId = this.$Route.query.id
this.categoryCid= this.$Route.query.cid
}).catch(err => {
uni.showToast({
title: err.message,
@@ -172,6 +291,25 @@
})
},
methods: {
// 选择商品服务
opnePopup(key){
this.$refs[key].open('bottom')
},
// 确认选择商品服务
affirmCategory(key, popupKey){
let keyArr = key == 'services' ? 'servicesArr' : 'storesArr'
this[key] = []
for(let val of this[keyArr]){
if(val.check){
this[key].push(val.service_id || val.store_id)
}
}
this.$refs[popupKey].close()
},
// picker选择
pickerChange(e, key){
this[key] = e.detail.value
},
// 图片预览
openImg(index, key){
let paths = this[key].map(val => {
@@ -212,6 +350,70 @@
})
}
})
},
// 发布产品
submitAdd(){
let pictures = this.pictures.map(val => {return val.path}),
content = this.content.map(val => {return val.path})
let submitData = {
name : this.name,
cover : this.pictures[0].path,
category_id : this.categoryId,
category_cid : this.categoryCid,
pictures : pictures,
content : content,
description : this.description,
is_post_sale : this.isPostSale ? 0 : 1,
services : this.services,
skus_cost : this.skus_cost,
skus_price : this.skus_price,
skus_number : this.skus_number,
skus_unit : this.skus_unit,
skus_charge : this.skus_charge,
skus_stock : this.skus_stock,
is_change : this.isChange ? 0 : 1,
logistic_type: this.logisticArr[this.logisticType].type,
stores : this.stores,
expiried_at : this.expiriedAt
}
let submitFund = this.$Route.query.type === 'edit' ? managesGoodsPut(this.$Route.query.id, submitData) : managesGoodsCreate(submitData)
submitFund.then(res => {
if(this.type === 2){
uni.showModal({
title : '提示',
content : '商品权证已发布,请耐心等待平台审核',
showCancel : false,
success : res => {
if(res.confirm){
this.$Router.back(this.$Route.query.type === 'edit' ? 1 : 2)
}
}
})
return
}
uni.showModal({
title : '提示',
content : this.$Route.query.type === 'edit' ? '商品权证已更新,是否立即补充产品附加信息认证?' : '商品权证已发布,是否立即补充产品附加信息认证?',
cancelText : '稍后认证',
confirmText : '立即认证',
success : res => {
if(res.cancel){
this.$Router.back(this.$Route.query.type === 'edit' ? 1 : 2)
}
if(res.confirm){
let goodsId = this.$Route.query.type === 'edit' ? this.$Route.query.id : res
this.$Router.push({name: 'goodsAuth', params: { id: goodsId , type: 'goodsAdd', edit: this.$Route.query.type === 'edit'}})
}
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
@@ -283,6 +485,15 @@
position: absolute;
}
}
.picker-switch{
line-height: 80rpx;
min-height: 80rpx;
text-align: right;
margin-right: -15rpx;
switch{
transform:scale(0.7)
}
}
}
.form-upd{
.form-title{
@@ -334,7 +545,7 @@
right: 0;
padding: 20rpx $padding;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
z-index: 99;
z-index: 9;
.footer-btn{
border: none;
border-radius: 0;
@@ -348,5 +559,69 @@
border: none;
}
}
}
// 可选服务
.category-popup{
background: #F5F5F5;
padding: 0 $padding * 2 $padding * 2 $padding * 2;
.header{
padding: $padding*2 0;
box-sizing: border-box;
@extend .vertical;
.title{
text-align: center;
font-size: $title-size + 14;
font-weight: bold;
line-height: 90rpx;
}
.subtitle{
font-size: $title-size-m;
color: $text-gray;
text-align: center;
}
}
.category-flex{
max-height: 50vh;
overflow-y: scroll;
.category-flex-item{
margin-bottom: $margin;
padding: $padding;
background: white;
border:solid 1rpx white;
box-sizing: border-box;
.category-name{
padding-bottom: $padding/2;
font-weight: bold;
font-size: $title-size-lg;
}
.category-content{
font-size: $title-size-sm;
color: $text-gray;
@extend .ellipsis;
}
&.show{
color: $text-price;
border:solid 1rpx $text-price;
}
&:last-child{
margin-bottom: 0;
}
}
}
.btns{
padding-top: $padding * 2;
button{
background: $text-price;
border-radius: 0;
height: 90rpx;
line-height: 90rpx;
font-size: $title-size;
color: white;
font-weight: bold;
&::after{
border: none;
}
}
}
}
</style>

View File

@@ -26,14 +26,15 @@
},
created() {
managesCategory().then(res => {
console.log(res)
this.loding = false
this.category = res
})
},
methods:{
// 选择分类
onCategory(id){
this.$Router.push({name: 'GoodsMagAdd', params: {id}})
onCategory(cid){
this.$Router.push({name: 'GoodsMagAdd', params: {cid, id: this.category[this.stairIndex].category_id}})
}
}
}

375
pages/goods/goodsAuth.vue Normal file
View File

@@ -0,0 +1,375 @@
<template>
<view class="content">
<view class="form-block">
<view class="form-upd">
<view class="form-title">产品实物图片<text>点击预览长按删除</text></view>
<view class="form-imgs">
<view
class="item"
v-if="extendCover.length > 0"
@click="openImg"
@longpress="extendCover = []"
>
<image class="item-cover" :src="extendCover[0].showpath" mode="aspectFill"></image>
</view>
<view class="item item-add" v-else @click="updCover">
<image class="item-cover" src="@/static/icons/add-icon.png" mode="aspectFill"></image>
</view>
</view>
</view>
</view>
<!-- 商品基本信息 -->
<view class="form-block">
<view class="form-box picker-flex">
<label class="form-label">生产日期</label>
<picker mode="date" :value="productedAt" @change="pickerChange($event, 'productedAt')">
<view class="picker-text">
{{productedAt || '选择商品生产日期'}}
<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view>
</picker>
</view>
<view class="form-box picker-flex">
<label class="form-label">过期时间</label>
<picker mode="date" :value="expiriedAt" @change="pickerChange($event, 'expiriedAt')">
<view class="picker-text">
{{expiriedAt || '选择商品过期时间'}}
<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view>
</picker>
</view>
<view class="form-box inputs-flex">
<label class="form-label">生产商名称</label>
<input type="text" v-model="productName" placeholder="输入商品生产商名称"/>
</view>
<view class="form-box inputs-flex">
<label class="form-label">生产许可证号</label>
<input type="text" v-model="lisence" placeholder="输入商品生产许可证号"/>
</view>
<view class="form-box inputs-flex">
<label class="form-label">生产商地址</label>
<input type="text" v-model="productAddress" placeholder="输入商品生产商地址"/>
</view>
</view>
<!-- 安全区 -->
<view class="ios-bottom"></view>
<!-- footer -->
<view class="footer">
<button class="footer-btn" type="default" @click="submitAdd">提交认证审核</button>
<view class="ios-bottom"></view>
</view>
</view>
</template>
<script>
import { managesGoodsAuth, managesGoodsExtends } from '@/apis/interfaces/goods'
import { uploads } from '@/apis/interfaces/uploading'
export default {
data() {
return {
productedAt : '', // 生产日期
expiriedAt : '', // 过期时间
lisence : '', // 生产许可证号
productName : '', // 生产商名称
productAddress : '', // 生产商地址
extendCover : [] // 实物图片
};
},
created() {
if(this.$Route.query.edit == 'true'){
managesGoodsExtends(this.$Route.query.id).then(res => {
this.productedAt = res.producted_at
this.expiriedAt = res.expiried_at
this.lisence = res.lisence
this.productName = res.product_name
this.productAddress = res.product_address
this.extendCover = [{...res.cover}]
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
},
methods: {
// picker选择
pickerChange(e, key){
this[key] = e.detail.value
},
// 图片预览
openImg(){
let paths = this.extendCover.map(val => {
return val.showpath
})
uni.previewImage({
urls : paths,
current : 0,
indicator: 'number'
})
},
// 上传图片
updCover(){
uni.chooseImage({
count : 1,
success : res => {
uploads([{
uri : res.tempFilePaths[0]
}]).then(updRes => {
this.extendCover.push({
path : updRes.path[0],
showpath: updRes.url[0]
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
})
},
// 发布产品
submitAdd(){
let submitData = {
producted_at : this.productedAt,
expiried_at : this.expiriedAt,
lisence : this.lisence,
product_name : this.productName,
product_address : this.productAddress,
extend_cover : this.extendCover[0].path
}
let submitFund = managesGoodsAuth(this.$Route.query.id, submitData)
submitFund.then(res => {
uni.showModal({
title : '提示',
content : '商品权证认证信息已提交,请耐心等待平台审核',
showCancel : false,
success : res => {
if(res.confirm){
if(this.$Route.query.type == 'goodsAdd'){
this.$Router.back(this.$Route.query.edit == 'true' ? 2 : 3)
}else{
this.$Router.back()
}
}
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss" scoped>
.content{
padding-bottom: 150rpx;
}
// 表单
.form-block{
background: white;
margin-top: $margin - 10;
.form-box{
position: relative;
padding-left: 240rpx;
padding-right: $padding;
font-size: $title-size-lg;
min-height: 80rpx;
&::after{
position: absolute;
bottom: 0;
left: $margin;
right: 0;
height: 1rpx;
content: " ";
background: $border-color;
}
&:last-child::after{
display: none;
}
.form-label{
position: absolute;
left: $margin;
line-height: 80rpx;
top: 0;
width: calc(240rpx - #{$margin});
}
}
.inputs-flex{
input{
height: 80rpx;
line-height: 80rpx;
}
}
.input-unit{
padding-right: 200rpx;
.units{
position: absolute;
right: 0;
top: 0;
line-height: 80rpx;
height: 80rpx;
width: 200rpx;
padding-right: $padding;
text-align: right;
box-sizing: border-box;
}
}
.picker-flex{
.picker-text{
position: relative;
line-height: 80rpx;
min-height: 80rpx;
padding-right: 80rpx;
@extend .nowrap;
.picker-icon{
right: 0;
position: absolute;
}
}
.picker-switch{
line-height: 80rpx;
min-height: 80rpx;
text-align: right;
margin-right: -15rpx;
switch{
transform:scale(0.7)
}
}
}
.form-upd{
.form-title{
font-size: $title-size-lg;
line-height: 80rpx;
padding: 0 $padding;
text{
font-size: 80%;
color: $text-gray;
}
}
.form-imgs{
margin-top: -($margin/3);
padding: 0 20rpx 20rpx;
display: flex;
flex-wrap: wrap;
.item{
width: calc(20% - 14rpx);
padding-top: calc(20% - 14rpx);
margin: 7rpx;
position: relative;
.item-cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
.item-add{
border: dashed 2rpx $border-color;
box-sizing: border-box;
.item-cover{
top: calc(15% - 2rpx);
left: calc(15% - 2rpx);
width: 70%;
height: 70%;
}
}
}
}
}
// 发布
.footer{
background: white;
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 20rpx $padding;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
z-index: 9;
.footer-btn{
border: none;
border-radius: 0;
background: $text-price;
height: 90rpx;
line-height: 90rpx;
font-weight: bold;
font-size: $title-size;
color: white;
&::after{
border: none;
}
}
}
// 可选服务
.category-popup{
background: #F5F5F5;
padding: 0 $padding * 2 $padding * 2 $padding * 2;
.header{
padding: $padding*2 0;
box-sizing: border-box;
@extend .vertical;
.title{
text-align: center;
font-size: $title-size + 14;
font-weight: bold;
line-height: 90rpx;
}
.subtitle{
font-size: $title-size-m;
color: $text-gray;
text-align: center;
}
}
.category-flex{
max-height: 50vh;
overflow-y: scroll;
.category-flex-item{
margin-bottom: $margin;
padding: $padding;
background: white;
border:solid 1rpx white;
box-sizing: border-box;
.category-name{
padding-bottom: $padding/2;
font-weight: bold;
font-size: $title-size-lg;
}
.category-content{
font-size: $title-size-sm;
color: $text-gray;
@extend .ellipsis;
}
&.show{
color: $text-price;
border:solid 1rpx $text-price;
}
&:last-child{
margin-bottom: 0;
}
}
}
.btns{
padding-top: $padding * 2;
button{
background: $text-price;
border-radius: 0;
height: 90rpx;
line-height: 90rpx;
font-size: $title-size;
color: white;
font-weight: bold;
&::after{
border: none;
}
}
}
}
</style>

View File

@@ -2,10 +2,10 @@
<view class="content">
<!-- 分类 -->
<view class="tabs">
<view class="item" :class="{'show': status == '1'}" @click="onTabs('1')">上架</view>
<view class="item" :class="{'show': status == '3'}" @click="onTabs('3')">已下架</view>
<view class="item" :class="{'show': status == '0'}" @click="onTabs('0')">审核中</view>
<view class="item" :class="{'show': status == '2'}" @click="onTabs('2')">已驳回</view>
<view class="item" :class="{'show': status == '0'}" @click="onTabs('0')">发布</view>
<view class="item" :class="{'show': status == '1'}" @click="onTabs('1')">待认证</view>
<view class="item" :class="{'show': status == '2'}" @click="onTabs('2')">审核中</view>
<view class="item" :class="{'show': status == '3'}" @click="onTabs('3')">已驳回</view>
</view>
<!-- 优选商品 -->
<goodsList :list="goods" priceType="CNY" :status='status' toast="暂无产品权证">
@@ -14,16 +14,19 @@
</template>
<template v-slot:footer="goods">
<view class="footer-btns">
<block v-if="status == '1'">
<block v-if="status == '0'">
<button class="button-item" size="mini" @click="openLay(goods.value, 'goodsBurn')">燃烧</button>
<button class="button-item" size="mini" @click="openLay(goods.value, 'goodsMint')">增发</button>
<button class="button-item" size="mini" @click="goodsOffsale(goods.value.goods_id)">下架</button>
</block>
<block v-if="status == '1'">
<button class="button-item" size="mini" @click="goodsAuth(goods.value.goods_id)">认证</button>
<button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button>
</block>
<block v-if="status == '2'">
<button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button>
</block>
<block v-if="status == '3'">
<button class="button-item" size="mini" @click="goodsOnsale(goods.value.goods_id)">上架</button>
</block>
<block v-if="status == '0' || status == '2'">
<button class="button-item" size="mini">修改</button>
<button class="button-item" size="mini" @click="goodsPut(goods.value.goods_id, goods.value.reason)">驳回原因</button>
<button class="button-item" size="mini" @click="goodsRemove(goods.value.goods_id)">删除</button>
</block>
</view>
@@ -48,7 +51,7 @@
</template>
<script>
import { managesGoodsIndex, managesGoodsOffsale, managesGoodsOnsale, managesGoodsBurn, managesGoodsMint, managesGoodsCreateBefore } from '@/apis/interfaces/goods'
import { managesGoodsIndex, managesGoodsDelete, managesGoodsBurn, managesGoodsMint, managesGoodsCreateBefore } from '@/apis/interfaces/goods'
import goodsList from '@/components/goods-list/goods-list'
export default {
components: {
@@ -56,7 +59,7 @@
},
data() {
return {
status : 1,
status : 0,
goods : [],
pages : {},
itemGoods : {},
@@ -71,6 +74,7 @@
// tabs
onTabs(value){
if(value == this.status) return
this.goods = []
this.status = value
this.getList()
},
@@ -79,23 +83,29 @@
managesGoodsIndex({
status: this.status
}).then(res => {
console.log(res)
this.goods = res.data
this.pages = res.page
})
},
// 下架
goodsOffsale(id){
let index = this.goods.findIndex(val => val.goods_id == id)
managesGoodsOffsale(id).then(res => {
this.goods.splice(index,1)
if(this.goods.length === 0) this.getList()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
// 修改产品
goodsPut(id, text){
uni.showModal({
title : '驳回原因',
content : text,
confirmText : '编辑',
cancelText : '确定',
success : res => {
if(res.confirm){
this.$Router.push({name: 'GoodsMagAdd', params: {type: 'edit', id}})
}
}
})
},
// 商品认证
goodsAuth(id){
this.$Router.push({name: 'goodsAuth', params: {id, type: 'magList'}})
},
// 燃烧,增发
openLay(item, type){
this.itemGoods = item
@@ -142,12 +152,16 @@
break;
}
},
// 上架
goodsOnsale(id){
// 移出删除商品
goodsRemove(id){
let index = this.goods.findIndex(val => val.goods_id == id)
managesGoodsOnsale(id).then(res => {
this.goods.splice(index,1)
if(this.goods.length === 0) this.getList()
managesGoodsDelete(id).then(res => {
this.goods.splice(index,1)
if(this.goods.length === 0) this.getList()
uni.showToast({
title: '商品权证已删除',
icon : 'none'
})
}).catch(err => {
uni.showToast({
title: err.message,
@@ -157,7 +171,7 @@
}
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'GoodsMagAdd'})
this.$Router.push({name: 'addClassify'})
}
}
</script>

338
pages/market/details.vue Normal file
View File

@@ -0,0 +1,338 @@
<template>
<view v-if="!loding">
<!-- 产品信息 -->
<view class="goods">
<image class="cover" :src="info.goods.cover" mode="aspectFill"></image>
<view class="content">
<view class="title nowrap">数字权证</view>
<view class="text nowrap">锚定商品{{info.goods.goods_name}}</view>
<view class="text nowrap">提供企业{{info.company.name}}</view>
<view class="text nav-goods nowrap" @click="onGoods">查看锚定商品信息<uni-icons type="arrowright" size="12" color="#e93340"></uni-icons></view>
</view>
<view class="info">
<view class="info-item">
<label>转让用户</label>
{{info.user.username}}
</view>
<view class="info-item">
<label>转让单价</label>
{{info.price}}
</view>
<view class="info-item">
<label>出售数量</label>
{{info.stock}}
</view>
<view class="info-item">
<label>剩余转让数量</label>
{{info.surplus}}
</view>
<view class="info-item">
<label>区块HASH</label>
{{info.hash}}
</view>
<view class="info-item">
<label>转让时间</label>
{{info.created_at}}
</view>
</view>
</view>
<button class="buy-btn" type="default" @click="openLay">我要购买</button>
<!-- 购买弹窗 -->
<uni-popup ref="buyLay" :safe-area="true" background-color="#ffffff">
<view class="popup">
<view class="title">我要购买</view>
<view class="des">
剩余转让数量
<text>{{info.surplus}}</text>
</view>
<view class="des">
数量
<uni-number-box v-model='stock' :min="1" :max="info.surplus" @change="countPrice"></uni-number-box>
</view>
<view class="des">
订单总价
<text class="price">{{price}}</text>
</view>
<view class="btn" @click="buy">提交订单</view>
</view>
</uni-popup>
<!-- 支付方式 -->
<uni-popup ref="payLay" :safe-area="true" background-color="#ffffff">
<view class="popup">
<view class="title">支付方式</view>
<radio-group class="pay-group" @change="payType">
<view class="item">
<label>
<radio class="pay-radio" value="eb" checked color="#e93340" />
<view class="pay-title">易货额支付</view>
<view class="pay-sub-title">可用{{account.eb}}冻结{{account.frozenEb}}</view>
</label>
</view>
<view class="item">
<label>
<radio class="pay-radio" value="wechat" color="#e93340" />
<view class="pay-title">微信支付</view>
</label>
</view>
</radio-group>
<view class="btn" @click="orderPay">立即支付</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { marketsInfo, marketsBuy, marketsPay } from '@/apis/interfaces/market'
export default {
data() {
return {
payValue: 'eb',
orderNo : '',
price : '0.00',
stock : 1,
loding : true,
info : {},
account : {
eb : '0.00',
frozenEb: '0.00'
}
};
},
created() {
marketsInfo(this.$Route.query.marketId || 5).then(res =>{
this.info = res
this.price = res.price
this.loding = false
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
methods:{
// 查看锚定产品
onGoods(){
this.$Router.push({name: 'marketGoods', params: { id: this.info.goods.goods_id }})
},
// 选择购买方式
payType(e){
this.payValue = e.detail.value
},
// 购买弹窗
openLay(){
this.$refs.buyLay.open('bottom')
},
// 计算价格
countPrice(e){
this.price = (e * this.info.price).toFixed(2)
},
// 提交购买单
buy(){
marketsBuy(this.info.market_id, {
qty: this.stock
}).then(res => {
this.account = res.account
this.orderNo = res.market_order_no
this.$refs.buyLay.close()
this.$refs.payLay.open('bottom')
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 支付
orderPay(){
let data = {}
marketsPay(this.orderNo, this.payValue).then(res => {
switch (this.payValue){
case 'eb':
console.log(res)
console.log('支付结果')
break
case 'wechat':
this.wxPay(JSON.parse(res))
break
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 微信支付
wxPay(payConfig){
uni.requestPayment({
provider : 'wxpay',
orderInfo : payConfig,
success : payRes => {
console.log(payRes)
},
fail : payErr => {
uni.showToast({
title: payErr.errMsg,
icon : 'none'
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
// 支付方式
.pay-group{
margin: 0 ($margin * 2);
.item{
position: relative;
border-bottom: solid 1rpx $border-color;
padding: $padding 0;
&:last-child{
border-bottom: none;
}
.pay-radio{
position: absolute;
right: 0;
top: 50%;
margin-top: -25rpx;
}
.pay-sub-title{
font-size: $title-size-sm;
color: $text-gray;
line-height: 40rpx;
}
.pay-title{
font-weight: bold;
line-height: 50rpx;
color: $text-color;
font-size: $title-size-lg;
text-align: left;
}
}
}
// 我要购买按钮
.buy-btn{
margin: 0 $margin;
background: $text-price;
color: white;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: $radius/2;
font-size: $title-size;
font-weight: bold;
&::after{
border: none;
}
}
// 产品信息
.goods{
min-height: 168rpx;
position: relative;
background: white;
border-radius: $radius/2;
margin: $margin;
padding: $padding;
.cover{
position: absolute;
left: $padding;
top: $padding;
width: 168rpx;
height: 168rpx;
}
.content{
padding-left: calc(168rpx + #{$padding});
.title{
position: relative;
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
line-height: 52rpx;
padding-right: 60rpx;
text{
position: absolute;
right: 0;
top: 0;
width: 60rpx;
text-align: right;
font-weight: normal;
}
}
.text{
font-size: $title-size-sm;
color: $text-gray;
height: 40rpx;
line-height: 40rpx;
&.nav-goods{
color: $text-price;
}
}
}
.info{
margin-top: $margin;
border-top: solid 1rpx $border-color;
padding-top: $padding;
.info-item{
padding-left: 200rpx;
height: 60rpx;
line-height: 60rpx;
position: relative;
text-align: right;
font-size: $title-size-m;
@extend .nowrap;
label{
position: absolute;
left: 0;
top: 0;
width: 200rpx;
text-align: left;
color: $text-gray;
}
}
}
}
// 购买产品
.popup {
width: 100%;
background-color: #fff;
padding-bottom: $padding;
.title {
font-size: 36rpx;
text-align: center;
padding: 50rpx 30rpx 30rpx 30rpx;
font-weight: bold;
}
.btn {
background-color: $text-price;
height: 90rpx;
line-height: 90rpx;
text-align: center;
color: #fff;
font-weight: bold;
font-size: $title-size;
margin: $padding * 2;
border-radius: $radius/2;
}
.des {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: $padding $padding * 2;
color: $text-gray;
font-size: $title-size-lg;
text{
color: $text-color;
}
.price{
color: $main-color;
font-weight: bold;
}
}
}
</style>

116
pages/market/goods.vue Normal file
View File

@@ -0,0 +1,116 @@
<template>
<view>
<view class="goods-cover">
<swiper class="swiper" circular indicator-dots indicator-active-color="#e93340">
<swiper-item v-for="(item, index) in cover" :key="index">
<view class="swiper-item">
<image class="swiper-cover" :src="item" mode="aspectFill" />
</view>
</swiper-item>
</swiper>
</view>
<view class="info">
<view class="info-item">
<label>锚定商品</label>
{{info.name}}
</view>
<view class="info-item">
<label>商品规格</label>
{{info.skusUnit}}
</view>
<view class="info-item">
<label>提供企业</label>
{{info.companyName}}
</view>
<view class="info-item">
<label>企业诚信</label>
{{info.integrity}}
</view>
<view class="info-item">
<label>权证销量</label>
{{info.sales}}
</view>
<view class="info-item">
<label>发布时间</label>
{{info.createdAt}}
</view>
</view>
</view>
</template>
<script>
import { goods } from '@/apis/interfaces/goods'
export default {
data() {
return {
cover: [],
info : {}
};
},
created() {
goods(this.$Route.query.id).then(res => {
console.log(res)
this.cover = res.pictures
this.info = {
name : res.name,
companyName : res.company.name,
createdAt : res.created_at,
sales : res.sales,
integrity : res.company.integrity,
skusUnit : res.skus[0].unit
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
</script>
<style lang="scss">
// 数权
.goods-cover{
width: 100%;
padding-top: 100%;
position: relative;
background: #f5f5f5;
.swiper{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper-item{
height: 100%;
width: 100%;
}
.swiper-cover{
@extend .swiper-item;
}
}
}
// 锚定商品详情
.info{
background: white;
padding: $padding;
.info-item{
padding-left: 200rpx;
height: 70rpx;
line-height: 70rpx;
position: relative;
text-align: right;
font-size: $title-size-m;
@extend .nowrap;
label{
position: absolute;
left: 0;
top: 0;
width: 200rpx;
text-align: left;
color: $text-gray;
}
}
}
</style>

View File

@@ -6,40 +6,57 @@
价格
<image
class="icon"
mode="widthFix" :src="require(marketType == 'low' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')"
mode="widthFix" :src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')"
/>
</view>
</view>
<view class="lists">
<view class="item" v-for="(item, index) in 10" :key="index">
<image class="cover" src="@/static/dev/good_cover_00.jpg" mode="aspectFill"></image>
<view class="item" v-for="(item, index) in marketArray" :key="index">
<image class="cover" :src="item.goods.cover" mode="aspectFill"></image>
<view class="content">
<view class="title nowrap">易品新境权证<text>*1</text></view>
<view class="text nowrap">谷风一木3层软抽面巾纸</view>
<view class="text nowrap">转让方温文尔雅的小阿玉</view>
<view class="text nowrap">Hashdjsakljkljfl3213dsaHKLDJS82231csa</view>
<view class="title nowrap">数字权证<text>{{item.surplus}}/{{item.stock}}</text></view>
<view class="text nowrap">锚定商品{{item.goods.goods_name}}</view>
<view class="text nowrap">提供企业{{item.company.name}}</view>
<view class="text nowrap">转让用户{{item.user.nickname}}</view>
</view>
<view class="price">21000.00/</view>
<view class="price">{{item.price}}/</view>
</view>
</view>
</view>
</template>
<script>
import { markets } from '@/apis/interfaces/market'
export default {
data() {
return {
tabIndex : 0,
marketType : 'low',
marketArray : []
marketType : 'asc',
marketArray : [],
page : {}
};
},
created() {
this.getMarkets()
},
methods:{
// 筛选产品
onTabs(e){
let index = e.target.dataset.index
if(index == 0 && index == this.tabIndex) return
if(index == 1 && index == this.tabIndex) this.marketType = this.marketType == 'low' ? 'high': 'low'
if(index == 1 && index == this.tabIndex) this.marketType = this.marketType == 'asc' ? 'desc': 'asc'
this.tabIndex = index
this.getMarkets()
},
// 获取转让市场
getMarkets(){
markets({
sort: this.tabIndex == 1 ? this.marketType : ''
}).then(res => {
console.log(res.data)
this.marketArray = res.data
this.page = res.page
})
}
},
onNavigationBarButtonTap(){

View File

@@ -1,19 +1,81 @@
<template>
<view>
成交历史
<block v-if="logs.length > 0">
<view class="logs" v-for="(item, index) in logs" :key="index">
<view class="logs-item">
<label>交易权证</label>
{{item.goods.goods_name}}
</view>
<view class="logs-item">
<label>交易单价</label>
{{item.price}}
</view>
<view class="logs-item">
<label>交易数量</label>
{{item.qty}}
</view>
<view class="logs-item">
<label>转让用户</label>
{{item.sellUser.nickname}}
</view>
<view class="logs-item">
<label>购买用户</label>
{{item.buyUser.nickname}}
</view>
<view class="logs-item">
<label>交易时间</label>
{{item.created_at}}
</view>
</view>
</block>
</view>
</template>
<script>
import { marketsLogs } from '@/apis/interfaces/market'
export default {
data() {
return {
logs: [],
page: {}
};
},
created(){
marketsLogs().then(res => {
console.log(res.data)
this.logs = res.data
this.page = res.page
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.logs{
background: white;
margin-top: $margin;
padding: ($padding - 10) $padding;
.logs-item{
padding-left: 200rpx;
height: 50rpx;
line-height: 50rpx;
position: relative;
text-align: right;
font-size: $title-size-m;
@extend .nowrap;
label{
position: absolute;
left: 0;
top: 0;
width: 200rpx;
text-align: left;
color: $text-gray;
}
}
}
</style>

253
pages/order/couponMore.vue Normal file
View File

@@ -0,0 +1,253 @@
<template>
<view class="Coupon">
<!-- 有优惠券列表 -->
<view class="coupon-content">
<couponTemplate v-for="(item,index) in lists" :key='index' :item="{...item}" />
</view>
<!-- 没有优惠券列表 -->
<no-list v-if="lists.length === 0" name='no-counpon' :txt="showTxt" />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
getCouponsListById
} from '@/apis/interfaces/coupon'
import couponTemplate from '@/components/coupon-template/coupon-template-1'
export default {
data() {
return {
lists:[],
id:'',
page:1,
has_more:true,
showTxt: '没有任何优惠券哦~'
};
},
components: {
couponTemplate
},
onLoad(e) {
console.log(e)
this.id = e.id
this.getMyCoupon()
},
onShow() {
if (wx.getStorageSync('refresh')) {
this.lists = []
this.getMyCoupon()
}
},
onPullDownRefresh() {
this.page = 1
this.lists = []
this.has_more = true
this.getMyCoupon()
},
onReachBottom() {
if (this.has_more) {
this.page = this.page + 1
this.getMyCoupon()
} else {
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
duration: 3000
})
}
},
methods: {
getMyCoupon() {
let id = this.id
let data={
page:this.page,
pageSize:4
}
getCouponsListById(id,data).then(res => {
console.log(res)
this.lists = this.lists.concat(res.data)
if (res.page.has_more) {
this.has_more = true
} else {
this.has_more = false
}
uni.stopPullDownRefresh()
wx.setStorageSync('refresh',false)
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
duration: 3000
})
})
},
// 选择顶部菜单
// selectNav(id) {
// console.log(typeof id)
// this.showTxt = (id === 1 ? '没有领取到任何优惠券哦~' : id === 2 ? '没有使用过任何优惠券哦~' : '没有任何过期优惠券哦~')
// if (id !== this.selectNavId) {
// this.selectNavId = id
// this.page = 1
// this.lists = []
// this.has_more = true
// this.getMyCoupon()
// }
// },
// 切换商品分类
selectNav(id) {
console.log(id)
this.selectNavId = id
this.getMyCoupon()
// if (this.selectCategoryId !== id) {
// this.goodsList = []
// this.has_more = true
// this.page = 1
// this.getGoodsByCompanyidCaregoryid()
// }
},
selectCategory(id) {
console.log(id)
this.selectCategoryId = id
this.getMyCoupon()
}
}
}
</script>
<style lang="scss" scoped>
.Coupon {
width: 100%;
min-height: 100vh;
box-sizing: border-box;
background-color: #F7F7F7;
padding-bottom: 20rpx;
.coupon-nav {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
box-sizing: border-box;
background-color: #fff;
padding: 30rpx 60rpx 0 60rpx;
color: #cacaca;
.nav-item {
padding: 20rpx 30rpx 30rpx 30rpx;
border-bottom: solid 4rpx #fff;
font-size: 36rpx;
font-weight: bold;
}
.nav-item-select {
border-bottom: solid 6rpx $main-color;
color: $main-color;
}
}
.scroll-top {
position: sticky;
top: 0;
z-index: 1000;
.scroll-view_H {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
white-space: nowrap;
width: 100%;
padding: 30rpx 30rpx 0 30rpx;
background-color: #fff;
.scroll-view-item_H {
margin-right: 60rpx;
padding: 20rpx 0 40rpx 0;
// height: 100rpx;
display: inline-block;
min-width: 120rpx;
font-size: 28rpx;
border-bottom: #fff;
background-color: #fff;
transition: .1s;
text-align: center;
}
.scroll-view-item_H_selected {
// border-bottom: solid $main-color 4rpx;
color: $main-color;
font-weight: bold;
// font-size: 36rpx;
// transition: .3s;
text-shadow: 6rpx 8rpx 30rpx rgba($color: $main-color, $alpha: .5);
position: relative;
&:after {
// content: '';
// position: absolute;
// bottom: 10rpx;
// left: 0;
// height: 8rpx;
// width: 100%;
// background-color: $main-color;
}
}
}
.scroll-view_H-1 {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
white-space: nowrap;
width: 100%;
padding: 0 30rpx 30rpx 30rpx;
background-color: #fff;
// position: sticky;
// top: 100rpx;
// z-index: 1000;
.scroll-view-item_H-1 {
display: inline-block;
min-width: 120rpx;
font-size: 24rpx;
border-bottom: #fff;
background-color: #f7f7f7;
margin-left: 20rpx;
padding: 10rpx 30rpx;
text-align: center;
border-radius: 40rpx;
}
.scroll-view-item_H_selected-1 {
// border-bottom: solid $main-color 4rpx;
color: #fff;
font-weight: bold;
background-image: linear-gradient(to left, $main-color, $main-color-light);
// font-size: 36rpx;
// transition: .3s;
// text-shadow: 6rpx 8rpx 30rpx rgba($color: $main-color, $alpha: .5);
position: relative;
&:after {
// content: '';
// position: absolute;
// bottom: 10rpx;
// left: 0;
// height: 8rpx;
// width: 100%;
// background-color: $main-color;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,217 @@
<template>
<view class="Collect-list">
<!--有收藏的店铺 -->
<view class="list-item" v-if="lists.length>0" v-for="(item,index) in lists" :key="index">
<view class="list-top">
<view class="list-top-left">
<image :src="item.cover" mode="aspectFill" class="list-banner"></image>
<view class="shop-info">
<view class="title ellipsis">{{item.name}}</view>
<view class="urate">
<u-rate :current="item.star" size="28rpx" :disabled="true"></u-rate>
</view>
<view class="des">销量:<span>100</span> <span> </span> 库存:<span>2524</span></view>
</view>
</view>
<view class="list-top-right" @click="onOpenWechat(item)">进店逛逛</view>
</view>
<view class="list-bottom">
<view class="list-bottom-item" v-for="(it,idx) in item.goods" :key='idx'>
<image class="goods-img" :src="it.cover" mode="aspectFill" @click="goGoods(it.goods_id)"></image>
<view class="money"> {{it.price.price_min}}</view>
</view>
</view>
</view>
<!-- 没有收藏的店铺 -->
<no-list name='no-shop' v-if="lists.length === 0" txt="您还没有收藏任何企业哦~" />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
shopSubscribeList
} from '@/apis/interfaces/mine'
export default {
data() {
return {
lists: [],
page: 1,
has_more: true,
};
},
onLoad(e) {
this.getList()
},
onReachBottom() {
if (this.has_more) {
this.page = this.page + 1
this.getGoodsByCompanyidCaregoryid()
} else {
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
type: 'primary',
duration: 3000
})
}
},
methods: {
// 获取列表
getList() {
shopSubscribeList(this.page).then(res => {
console.log(res)
this.lists = this.lists.concat(res.data)
if (res.page.has_more) {
this.has_more = true
} else {
this.has_more = false
}
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
// 打开微信小程序
onOpenWechat(e){
plus.share.getServices(res => {
let sweixin = null;
for(let val of res){
if(val.id === 'weixin'){
sweixin = val
}
}
/** 以此为例子 显示跳转引导页
* 'index_4'
* index 跳小程序企业首页
* 4 企业id
**/
if(sweixin != null){
sweixin.launchMiniProgram({
id : e.original_id,
path: 'pages/login/guide?scene=index_' + e.company_id,
})
}else{
uni.showToast({
title: '当前环境不支持打开微信小程序',
icon : 'none'
})
}
})
},
// 跳转商城
goShop(company_id) {
uni.setStorageSync('company_id', company_id)
uni.setStorageSync('refresh',true)
this.$Router.pushTab({
name: 'Goods'
})
},
goGoods(id) {
this.$Router.push({name: 'goodsDetails', query: {id: id}})
}
}
}
</script>
<style lang="scss" scoped>
.Collect-list {
.list-item {
border-top: solid 20rpx #F7F7F7;
padding: 0 30rpx 30rpx 30rpx;
.list-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 30rpx 0;
font-size: $title-size*0.94;
border-bottom: solid 1rpx #f7f7f7;
.list-top-left {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.title {
width: 380rpx;
font-size: $title-size*1;
font-weight: 400;
}
.urate {
padding: 10rpx 0;
}
.des {
// padding-top: $padding*0.8;
font-size: $title-size * 0.8;
color: #999;
span {
color: #666;
padding: 0 10rpx;
}
}
.list-banner {
width: 120rpx;
margin-right: $margin*1.5;
height: 120rpx;
border-radius: 4rpx;
}
}
.list-top-right {
border: solid 1rpx $main-color;
color: $main-color;
display: inline-block;
padding: 8rpx 16rpx;
font-size: $title-size *0.8;
border-radius: 4rpx;
}
}
.list-bottom {
margin-top: 20rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
// padding: 0 30rpx;
.list-bottom-item {
width: 160rpx;
height: 160rpx;
position: relative;
.goods-img {
width: 100%;
height: 100%;
}
.money {
position: absolute;
bottom: 0;
right: 0;
background-color: rgba($color: #000000, $alpha: 0.5);
color: #fff;
padding: 2rpx 8rpx;
font-size: $title-size *0.9;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,217 @@
<template>
<view class="can-use-list">
<view v-for="(item,index) in lists" v-if="lists.length>0" :key="index" style="padding: 0 30rpx;">
<view class="goods-item">
<image class="goods-img" hover-class="none" mode="aspectFill" @click="goDetail(item.goods_id)"
:src="item.cover" />
<view class="goods-info">
<view class="goods-title ellipsis-2">{{item.name}}</view>
<view class="flexrow">
<view class="goods-price"><span></span>{{item.price}}/权证</view>
<view :class="['right',selectSkuId===item.goods_sku_id?'selcetRight':'']"
@click="selectSkuId = item.goods_sku_id"> 兑换该商品</view>
</view>
</view>
</view>
</view>
<!-- 没有收藏的店铺 -->
<no-list name='no-goods' v-else txt="没有任何可兑换商品~" />
<view class="nowExchange" ><view class="btn" @click="verifiyCoupon('post')">确认兑换</view></view>
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
scanInfo
} from '@/apis/interfaces/scan'
export default {
data() {
return {
lists: [],
page: 1,
exchangeShow: false, // false不显示立即兑换按钮
has_more: true,
code: '',
selectSkuId: ''
};
},
onLoad(e) {
if (e.code) {
this.code = e.code
}
this.verifiyCoupon('get')
},
methods: {
// 获取列表
verifiyCoupon(method) {
let apiUrl = 'coupons/verify/coupon'
let data = {
code: this.code
}
if(method === 'post'){
data.goods_sku_id = this.selectSkuId
}
scanInfo(apiUrl, data, method).then(res => {
console.log(res)
if(method === 'get'){
this.lists = res.goods
}else{
this.$refs.uToast.show({
title: '优惠券核销成功',
type: 'error',
icon: false,
duration: 3000
})
setTimeout(res=>{
uni.navigateBack({})
},3000)
}
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'error',
icon: false,
duration: 3000
})
})
},
goDetail(id) {
console.log(id)
uni.navigateTo({
url: '/pages/goods/details?id=' + id
})
}
}
}
</script>
<style lang="scss" scoped>
.can-use-list {
padding-bottom: 120rpx;
}
.goods-item {
width: calc(100% - 20rpx);
box-shadow: 0 0 20rpx 4rpx rgba($color: $main-color, $alpha: 0.1);
border-radius: 16rpx;
// margin-left: 20rpx;
margin: 40rpx 0 0 20rpx;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
position: relative;
.exchange {
position: absolute;
bottom: 30rpx;
right: 30rpx;
padding: 6rpx 16rpx;
border-radius: 20rpx 0 20rpx 0;
background-color: $main-color;
color: #fff;
font-size: 20rpx;
z-index: 1;
}
.goods-img {
width: 180rpx;
height: 180rpx;
position: relative;
top: 0;
left: -20rpx;
box-shadow: 0 0 10rpx 4rpx rgba($color: $main-color, $alpha: 0.1);
border-radius: 8rpx;
}
.goods-info {
flex: 1;
height: 180rpx;
padding: 20rpx 20rpx 20rpx 0;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-around;
box-sizing: border-box;
.goods-title {
width: 100%;
font-size: 28rpx;
}
.goods-price {
color: #039bfe;
padding-top: 10rpx;
font-weight: bold;
font-size: 32rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
span {
font-size: 26rpx;
// padding-right: 10rpx;
font-weight: normal;
&:nth-child(2) {
padding-left: 30rpx;
}
}
}
}
}
.flexrow {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.right {
padding: 20rpx 20rpx;
border-radius: 20rpx;
background-color: #cacaca;
color: #666;
}
.selcetRight {
background-color: #039bfe;
color: #fff;
font-weight: bold;
}
}
.nowExchange {
height: 90rpx;
background-color: #fff;
position: fixed;
bottom: 40rpx;
width: 100%;
padding:20rpx 30rpx;
.btn {
background-color: #039bfe;
font-size: 34rpx;
font-weight: bold;
color: #FFF;
padding: 20rpx 30rpx;
box-sizing: border-box;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
border-radius: 8rpx;
}
}
</style>

View File

@@ -2,7 +2,7 @@
<view class="Coupon">
<!-- 有优惠券列表 -->
<view class="coupon-content">
<couponTemplate v-for="(item,index) in lists" :key='index' :item="{...item}" />
<couponTemplate v-for="(item,index) in lists" :key='index' :item="{...item}" :action="actions" />
</view>
<!-- 没有优惠券列表 -->
@@ -34,7 +34,7 @@
},
onLoad(e) {
console.log(e)
this.id = this.$route.query.id
this.id = e.id
this.getMyCoupon()
},
onShow() {
@@ -56,6 +56,7 @@
} else {
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
type: 'primary',
duration: 3000
})
}
@@ -80,9 +81,9 @@
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
// 选择顶部菜单
@@ -124,7 +125,6 @@
min-height: 100vh;
box-sizing: border-box;
background-color: #F7F7F7;
padding-bottom: 20rpx;
.coupon-nav {
display: flex;

View File

@@ -12,9 +12,9 @@
<view class="goods-title" v-if="info.goods.length>0">可用商品 <span
style='font-size: 24rpx;color:gray;'>多选一</span></view>
<view class="goods-item" v-if="info.goods.length>0" v-for="(item,index) in info.goods" :key='index'>
<image :src="item.cover" mode="aspectFill" class="goods-img" @click="$router.push({name:'goodsDetails',query:{id:item.goods_id}})" />
<image :src="item.cover" mode="aspectFill" class="goods-img" @click="goDetail(item.goods_id)" />
<view class="goods-right">
<view class="goods-right-title ellipsis-2" @click="$router.push({name:'goodsDetails',query:{id:item.goods_id}})">{{item.name}}</view>
<view class="goods-right-title ellipsis-2" @click="goDetail(item.goods_id)">{{item.name}}</view>
<view class="goods-right-bottom">
<span class='money'>{{item.price}}</span>
<view class="used" v-if='info.use_way.value=== 1' @click="nowBuy(item)">立即购买</view>
@@ -38,7 +38,7 @@
<view class="showCode " v-if="showCode">
<view class="showCodeBg" @click="showCode = false"></view>
<view :class="['showCodeContent', showCode?'showCodeContentSelect':'showCodeContentSelectNo']">
<view class="showCodeTitle">商品兑换码</view>
<view class="showCodeTitle">优惠券兑换码</view>
<image :src="code" mode="widthFix"></image>
</view>
</view>
@@ -67,10 +67,17 @@
GoodTemplate
},
onLoad(e) {
console.log(this.$route)
this.coupon_grant_id = this.$route.query.id
this.coupon_grant_id = e.id
this.getList()
},
// 监听弹窗页面为false时候重新请求当前页面
watch: {
showCode(newVal, oldVal) {
if(!newVal && oldVal){
uni.setStorageSync('refresh',true)
}
}
},
methods: {
// 获取列表
getList() {
@@ -87,16 +94,14 @@
},
// 点击立即购买去商品确认页面
nowBuy(items) {
console.log(items, 'items....')
let data = {
skuId: items.goods_sku_id,
qty: 1
}
this.$router.push({
name: 'Buy',
params: data
uni.navigateTo({
url:'/pages/order/buy?qty=1&skuId='+items.goods_sku_id,
})
},
goDetail(id){
uni.navigateTo({
url:'/pages/goods/details?id='+id
})
console.log(data)
},
// 点击二维码特效
clickCode(grantid) {
@@ -152,7 +157,7 @@
// 优惠券
.coupon {
margin: 0 $margin * 2;
margin: 0 $margin;
background-color: #Fff;
position: relative;
z-index: 1;
@@ -182,7 +187,7 @@
// 可用商品
.goods-item {
background-color: #fff;
margin: $margin*1.5 $margin * 2;
margin: $margin*1.5 $margin;
border-radius: 20rpx;
display: flex;
flex-direction: row;
@@ -237,18 +242,18 @@
font-size: 34rpx;
font-weight: bold;
text-align: left;
margin: $margin*2;
margin: $margin $margin;
// text-shadow:10rpx 10rpx linear-gradient(to right, #f39e17, #f85b05);
text-shadow: 2rpx 2rpx 10rpx $main-color;
}
// 描述
.describe {
margin: $margin * 2 0;
margin: $margin 0;
.describe-des {
color: #999;
padding: 10rpx $margin * 2;
padding: 10rpx $margin ;
font-size: 28rpx;
}
}

View File

@@ -1,22 +1,327 @@
<template>
<view>
eb账户
<view class="Record">
<view class="record-top">
<image src="/static/images/record_bg.png" mode="widthFix" class="record-bg" />
<view class="record-top-nav">
<view :class="['record-top-item',type==='year'?'selectTopItem':'']" @click="selectType('year')">年账单</view>
<view :class="['record-top-item',type==='month'?'selectTopItem':'']" @click="selectType('month')">月账单</view>
<view :class="['record-top-item',type==='day'?'selectTopItem':'']" @click="selectType('day')">日账单</view>
</view>
<view class="record-mouth-year">
<view class="record-type-left">
<u-picker mode="time" v-model="show" :params="params" @confirm ='confirm' title ='筛选日期' start-year='2021' :end-year='currentYear'/>
<view @click="show = true">
{{date?date:'选择日期'}}
<uni-icons type="arrowdown" color="#fff" size="12" />
</view>
</view>
<view class="record-type-right">
<view :class="['pay_type_item',cointype==='in'?'pay_type_item_select':'']" @click="selectCoinType('in')">收入</view>
<view :class="['pay_type_item',cointype==='out'?'pay_type_item_select':'']" @click="selectCoinType('out')">支出</view>
</view>
</view>
<view class="record-title">可用额度 ( EB ) </view>
<view class="record-money"><span></span>{{account}} <span></span></view>
<!-- <view class="">待解锁额度</view>
<view class="">授信额度</view> -->
</view>
<!-- 列表 -->
<view class="record-list" v-if="lists.length>0">
<view class="record-list-item" v-for="(item,index) in lists" :key='index'>
<view class="record-list-item-top">
<view class="title">{{item.note}}</view>
<view class="money">{{cointype==='in'?'+':'-'}}{{item.amount}} </view>
</view>
<view class="record-list-item-date">{{item.blockTime}}</view>
</view>
</view>
<!-- 无列表 -->
<no-list v-if="lists.length === 0 && cointype === 'in'" name='no-in' txt="没有任何收入记录" />
<no-list v-if="lists.length === 0 && cointype === 'out'" name='no-out' txt="没有任何支出记录" />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {chaineb} from '@/apis/interfaces/mine';
export default {
data() {
return {
lists:[],
has_next_page:true,
page:1,
type:'year', // 统计类型day日month月year年
cointype:'in',// in 收入 out 支出
date:new Date().toISOString().slice(0,4), // 日Y-m-d月Y-m年Y
params: {
year: true,
month: true,
day: true
},
show: false, // 显示
currentDay:new Date().toISOString().slice(0,10),
currentMonth:new Date().toISOString().slice(0,7),
currentYear:new Date().toISOString().slice(0,4),
account:''
}
},
onLoad(){
this.getList()
},
onReachBottom(){
if (this.has_next_page) {
this.page = this.page + 1
this.getList()
} else {
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
type: 'error',
icon:false,
duration: 3000
})
}
},
methods: {
// 获取列表
getList(){
let data = {
page:this.page,
type:this.type,
date:this.date,
cointype:this.cointype
}
chaineb(data).then(res => {
console.log(res)
this.account = res.account
this.lists = this.lists.concat(res.lists)
this.has_next_page = res.has_next_page
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'error',
icon:false,
duration: 3000
})
})
},
selectCoinType(type){
if(this.cointype !== type){
this.cointype = type
this.reset()
}
},
// 重置
reset(){
this.page = 1
this.lists = []
this.has_next_page = true
this.getList()
},
// 选择 年 月 日 切换要重置数据
selectType(type){
console.log(type,typeof type)
if(this.type !== type){
switch(type){
case 'year':
this.type = type
this.params= {
year: true,
month: false,
day: false
}
this.date = this.currentYear
this.reset()
break;
case 'month':
this.type = type
this.params= {
year: true,
month: true,
day: false
}
this.date = this.currentMonth
this.reset()
break;
case 'day':
this.type = type
this.params= {
year: true,
month: false,
day: false
}
this.date = this.currentDay
this.reset()
break;
}
}
},
// 点击确认按钮
confirm(e){
let type = this.type
switch(type){
case 'year':
this.date = e.year
this.reset()
break;
case 'month':
this.date = e.year + '-' + e.month
this.reset()
break;
case 'day':
this.date = e.year + '-' + e.month + '-' + e.day
this.reset()
break;
}
}
}
}
</script>
<style>
<style lang="scss" scoped>
page {
background-color: #f7f7f7;
}
.Record {
width: 100%;
height: 100vh;
padding-top: 30rpx;
background-color: #fff;
}
.record-top {
width: calc(100% - 60rpx);
height: 360rpx;
background-image: linear-gradient(to left, #f40c50 , #f40c50);
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: $main-color, $alpha: 0.4);
margin: 0 30rpx;
border-radius: 20rpx;
box-sizing: border-box;
position: relative;
padding: 10rpx 50rpx 20rpx 50rpx;
z-index: 1;
.record-bg {
position: absolute;
width: 230rpx;
bottom: 0;
right: 30rpx;
z-index: 1;
}
.record-top-nav {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.record-top-item {
margin: 40rpx 20rpx;
font-size: 30rpx;
font-weight: 500;
color: #fff;
}
.selectTopItem{
border-bottom: solid 4rpx #fff;
}
}
.record-mouth-year {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
position: relative;
z-index: 2;
color: #fff;
font-size: 30rpx;
.record-type-left {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
uni-icons {
margin-left: 4rpx;
}
}
.record-type-right {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
font-size: 24rpx;
.pay_type_item {
margin: 0 10rpx;
padding: 2rpx 20rpx;
border-radius: 30rpx;
border: solid 1rpx rgba($color: #000000, $alpha: 0);
}
.pay_type_item_select{
border: solid 1rpx #f7f7f7;
}
}
}
.record-title {
font-size: 28rpx;
color: #fff;
padding: 20rpx 0;
}
.record-money {
color: #fff;
font-size: 50rpx;
font-weight: bold;
span {
font-size: 30rpx;
font-weight: 400;
margin-right: 4rpx;
}
}
}
.record-list {
padding: 20rpx 30rpx;
.record-list-item {
padding: 20rpx 0;
border-bottom: solid 1rpx #f7f7f7;
.record-list-item-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.title {
font-size: 30rpx;
width: 400rpx;
}
.money {
color: #f40c50;
font-size: 34rpx;
font-weight: bold;
}
}
.record-list-item-date {
font-size: 24rpx;
color: #a6a6a6;
margin-top: 10rpx;
}
}
}
</style>

View File

@@ -0,0 +1,139 @@
<template>
<view class="HistoryList">
<!-- 有足迹 -->
<view class="goodsList" v-if="lists.length>0">
<view class="date">以往足迹</view>
<view class="lists">
<view class="lists-item" v-for="(item,index) in lists" :key="index" @click="goGoods(item.goods_id)">
<image class="goods-img" :src="item.cover" mode="aspectFill" />
<view class="money"><span class="tags" v-if='item.tags.length>0'>{{item.tags[0].name}}</span><span>¥</span>{{item.price}}</view>
</view>
</view>
</view>
<!-- 没有任何足迹 -->
<no-list v-if="lists.length === 0" name='no-foot' txt="您还没有产生任何足迹哦~" />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
browsers
} from '@/apis/interfaces/mine'
export default {
data() {
return {
lists: [],
page: 1,
has_more: true
}
},
onLoad() {
this.getLists()
},
onReachBottom() {
console.log('this.has_more',this.has_more)
if (this.has_more) {
this.page = this.page + 1
this.getLists()
} else {
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
duration: 3000
})
}
},
methods: {
getLists() {
browsers(this.page).then(res => {
console.log(res)
this.lists = this.lists.concat(res.data)
this.has_more = res.page.has_more
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
// 跳转到商品详情
goGoods(id) {
console.log(id)
uni.navigateTo({
url: '/pages/goods/details?id=' + id
})
}
}
}
</script>
<style lang="scss" scoped>
.HistoryList {
background-color: #fff;
width: 100%;
min-height: 100vh;
.goodsList {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
padding: 20rpx 10rpx 20rpx 15rpx;
border-bottom: solid 1rpx #f7f7f7;
.date {
margin-left: 10rpx;
font-size: $title-size * 1.12;
font-weight: bold;
}
.lists {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
flex-wrap: wrap;
width: 100%;
.lists-item {
margin: 20rpx 10rpx 10rpx 10rpx;
width: 220rpx;
.goods-img {
width: 220rpx;
height: 220rpx;
border-radius: 10rpx;
}
.money {
color: #FA3534;
font-size: $title-size*0.9;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.tags {
background-color: #FA3534;
color: #fff;
padding: 2rpx 12rpx;
border-radius: 6rpx;
font-size: $title-size * 0.7 !important;
margin-right: 10rpx;
}
span {
font-size: $title-size * 0.8;
}
}
}
}
}
}
</style>

View File

@@ -1,17 +1,17 @@
<template>
<view>
<view v-if='loaded'>
<!-- 用户信息 -->
<view class="user">
<view class="user-tool">
<image src="@/static/icons/user_icon_00.png" mode="widthFix" />
<view class="user-tool" @click="$Router.push({name:'Setting'})">
<image src="@/static/icons/user_icon_00.png" mode="widthFix" />
</view>
<view class="user-content">
<image class="info-cover" src="../../static/dev/good_cover_00.jpg" mode="aspectFill" />
<view class="info-nickname">唐明明</view>
<image class="info-cover" :src="base.avatar" mode="aspectFill" />
<view class="info-nickname">{{base.nickname}}</view>
<view class="info-signa">潮流就是我的态度</view>
<view class="info-tags">
<text class="info-tags-item identity">普通用户</text>
<text class="info-tags-item vip">PULS企业</text>
<text class="info-tags-item identity">{{base.identity.name}}</text>
<text class="info-tags-item vip" v-if="base.company_level.name">{{base.company_level.name }}</text>
</view>
</view>
<view class="user-tabs">
@@ -23,11 +23,8 @@
<view class="user-ad">
<uni-icons class="user-ad-icon" type="sound-filled" color="#e93340"></uni-icons>
<swiper class="user-ad-swiper" :interval="3000" autoplay vertical circular>
<swiper-item>
<view class="user-ad-item">恭喜用户0101成功开通PLUS企业会员</view>
</swiper-item>
<swiper-item>
<view class="user-ad-item">恭喜用户0101成功开通PLUS企业会员</view>
<swiper-item v-for="(item,index) in message" :key='index'>
<view class="user-ad-item">{{item}}</view>
</swiper-item>
</swiper>
</view>
@@ -38,20 +35,20 @@
<view class="title-text">我的资产</view>
</view>
<view class="group-flex group-flex-4">
<view class="item">
<view class="item-num">0</view>
<view class="item" @click="showToast">
<view class="item-num">{{base.account.token}}</view>
<view class="item-title">原石</view>
</view>
<view class="item">
<view class="item-num">0</view>
<view class="item" @click="showToast">
<view class="item-num">{{base.account.contribution}}</view>
<view class="item-title">贡献值</view>
</view>
<view class="item">
<view class="item-num">0</view>
<view class="item" @click="$Router.push({name:'Eb'})">
<view class="item-num">{{base.account.eb}}</view>
<view class="item-title">易币</view>
</view>
<view class="item">
<view class="item-num">0</view>
<view class="item" @click="showToast">
<view class="item-num">{{base.account.money}}</view>
<view class="item-title">零钱</view>
</view>
</view>
@@ -63,19 +60,19 @@
</view>
<view class="group-flex group-flex-4">
<view class="item" @click="$Router.push({name:'NumberWeight'})">
<view class="item-num">0</view>
<view class="item-num">{{count.warrnats}}</view>
<view class="item-title">权证持有</view>
</view>
<view class="item" @click="$Router.push({name:'33'})">
<view class="item-num">0</view>
<view class="item" @click="showToast">
<view class="item-num">{{count.warrnat_transfer}}</view>
<view class="item-title">权证转让</view>
</view>
<view class="item" @click="$Router.push({name:'334'})">
<view class="item-num">0</view>
<view class="item" @click="$Router.push({name:'ServicesOrder'})">
<view class="item-num">{{count.shipment_fuwu_count}}</view>
<view class="item-title">已使用</view>
</view>
<view class="item" @click="$Router.push({name:'MallShipments'})">
<view class="item-num">0</view>
<view class="item-num">{{count.shipment_goods_count}}</view>
<view class="item-title">已提货</view>
</view>
</view>
@@ -83,18 +80,18 @@
<!-- 我的权证 -->
<view class="user-group">
<view class="group-flex group-flex-4">
<view class="item">
<image class="item-cover" src="@/static/icons/user_icon_01.png" mode="aspectFill" />
<view class="item-title">商品收藏</view>
</view>
<view class="item">
<view class="item" @click="$Router.push({name:'Collection'})">
<image class="item-cover" src="@/static/icons/user_icon_02.png" mode="aspectFill" />
<view class="item-title">关注企业</view>
<view class="item-title">收藏的企业</view>
</view>
<view class="item" @click="$Router.push({name:'CouponList'})">
<image class="item-cover" src="@/static/icons/user_icon_03.png" mode="aspectFill" />
<view class="item-title">我的优惠券</view>
</view>
<view class="item" @click="$Router.push({name:'HistoryShop'})">
<image class="item-cover" src="@/static/icons/user_icon_01.png" mode="aspectFill" />
<view class="item-title">我的足迹</view>
</view>
<view class="item" @click="$Router.push({name:'AddressList'})">
<image class="item-cover" src="@/static/icons/user_icon_04.png" mode="aspectFill" />
<view class="item-title">地址管理</view>
@@ -110,11 +107,11 @@
</view>
<view class="group-flex group-flex-2">
<view class="item">
<view class="item-num">0</view>
<view class="item-num">{{relations.children}}</view>
<view class="item-title">推广人数</view>
</view>
<view class="item">
<view class="item-num">0</view>
<view class="item-num">{{relations.company}}</view>
<view class="item-title">推广企业</view>
</view>
</view>
@@ -128,28 +125,32 @@
<view class="ranking ranking-after">
<view class="ranking-title">
<view class="ranking-text">全站推广人数</view>
<view class="ranking-number">5</view>
<view class="ranking-number">{{relations.childrenRank}}</view>
</view>
<image class="tips" src="../../static/icons/property_icon_00.png" mode="aspectFill" />
</view>
<view class="ranking">
<view class="ranking-title">
<view class="ranking-text">推广企业</view>
<view class="ranking-number">5</view>
<view class="ranking-number">{{relations.companyRank}}</view>
</view>
<image class="tips" src="../../static/icons/property_icon_01.png" mode="aspectFill" />
</view>
</view>
<!-- 推广海报 -->
<view class="poster-text">推广海报</view>
<carousel :img-list="imgList" url-key="url" @selected="selectedBanner"/>
<view class="" @click="outLogin">
临时退出
</view>
<!-- <carousel :img-list="imgList" url-key="url" @selected="selectedBanner"/> -->
<view class="code">
<image class="code-img-bg" src="/static/images/share_bg_3.png" mode="aspectFill" />
<image class='code-img' :src="shareCode" mode="widthFix" />
</view>
</block>
<!-- 弹窗 -->
<u-toast ref="uToast" />
<!-- 版权信息 -->
<view class="copyright">易品新境 beta 1.0.0</view>
</view>
@@ -157,13 +158,14 @@
<script>
import carousel from '@/components/vear-carousel/vear-carousel'
import {getUserInfo , appcode} from '@/apis/interfaces/mine'
export default {
components: {
carousel
},
data() {
return {
tabsIndex: 1,
tabsIndex: 0,
imgList: [{
url: 'https://img9.51tietu.net/pic/2019-091200/vgkpidei2tjvgkpidei2tj.jpg',
id: 1
@@ -173,15 +175,59 @@
},{
url: 'https://img9.51tietu.net/pic/2019-091200/143tt0ta4sr143tt0ta4sr.jpg',
id: 3
}]
}],
base:'',
count:'',
relations:'',
message:'',
loaded:false,
shareCode:''
}
},
onShow(){
this.getUserInfo()
},
methods: {
// 获取用户的基本信息
getUserInfo(){
getUserInfo().then(res => {
this.base = res.base
this.count = res.count
this.message = res.message
this.relations = res.relations
this.loaded = true
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'error',
icon:false,
duration: 3000
})
})
appcode().then(res => {
this.shareCode = res.code
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'error',
icon:false,
duration: 3000
})
})
},
outLogin(){
this.$store.commit('setToken', '')
},
selectedBanner(item, index) {
console.log('🥒', item, index)
},
// 努力开发中,,,
showToast(){
this.$refs.uToast.show({
title: '努力开发中',
type:'error',
duration: 3000
})
}
}
}
@@ -411,13 +457,31 @@
margin: $margin + 10 0 0;
text-align: center;
}
.code{
width: 700rpx;
height: 400rpx;
background-color: red;
margin: 25rpx;
position: relative;
.code-img-bg{
width: 100%;
height: 100%;
}
.code-img{
width: 220rpx;
position: absolute;
left: 30rpx;
top: 50%;
margin-top: -90rpx;
}
}
// 易货订单
.order-flex{
.item{
width: calc(20% - #{$padding - 10});
width: calc(25% - #{$padding - 10});
.item-num{
font-weight: bold;
font-size: $title-size + 4;
font-size: $title-size;
}
.item-cover{
width: 72rpx;

View File

@@ -60,7 +60,7 @@
id: 'signed'
},
{
name: '待退权',
name: '待退权',
id: 'process'
},
{
@@ -136,7 +136,7 @@
console.log(index,no)
uni.showModal({
title: '哎呦,提醒你',
content: '是否确认要取消订单啊,取消后请去我的权中查看',
content: '是否确认要取消订单啊,取消后请去我的权中查看',
success: (res) =>{
if (res.confirm) {
mallShipmentsCancel(no).then(res=>{

View File

@@ -38,7 +38,7 @@
<view class="name1 ellipsis-2">{{info.goods_sku.goods_name}}</view>
<!-- <span>16.80</span> -->
</view>
<view class="sku">权个数 <span>x {{info.qty}}</span> </view>
<view class="sku">个数 <span>x {{info.qty}}</span> </view>
</view>
</view>
<navigator class="total" hover-class="none" :url='"/pages/goods/detail?id="+info.goods_sku.goods_id'>

View File

@@ -139,7 +139,7 @@
id: 'signed'
},
{
name: '待退数权',
name: '待确认退货',
id: 'process'
},
{
@@ -216,6 +216,7 @@
apiUrl = 'mall/shipments/post'
} else if(this.selectTypeId === 'take') {
apiUrl = 'mall/shipments/shop'
data.channel = 'app'
} else if(this.selectTypeId === 'refund') {
apiUrl = 'mall/refunds'
}
@@ -238,7 +239,7 @@
console.log(index, no)
uni.showModal({
title: '哎呦,提醒你',
content: '是否确认要取消订单啊,取消后请去我的权中查看',
content: '是否确认要取消订单啊,取消后请去我的权中查看',
success: (res) => {
if (res.confirm) {
mallShipmentsCancel(no).then(res => {

View File

@@ -38,7 +38,7 @@
<view class="name1 ellipsis-2">{{info.goods_sku.goods_name}}</view>
<!-- <span>16.80</span> -->
</view>
<view class="sku">权个数 <span>x {{info.qty}}</span> </view>
<view class="sku">个数 <span>x {{info.qty}}</span> </view>
</view>
</view>
<navigator class="total" hover-class="none" :url='"/pages/goods/detail?id="+info.goods_sku.goods_id'>
@@ -135,7 +135,7 @@
nowCancel(no){
uni.showModal({
title: '哎呦,提醒你',
content: '是否确认要取消订单啊,取消后请去我的权中查看',
content: '是否确认要取消订单啊,取消后请去我的权中查看',
success: (res) =>{
if (res.confirm) {
mallShipmentsCancel(no).then(res=>{

View File

@@ -155,6 +155,15 @@
this.getInfo(e.symbol)
// this.getInfo('G22S20')
},
// 监听弹窗页面为false时候重新请求当前页面
watch: {
showCode(newVal, oldVal) {
if(!newVal && oldVal){
this.getInfo(this.symbol)
uni.setStorageSync('refresh',true)
}
}
},
methods: {
getInfo(symbol) {
mallWarrantsList(symbol).then(res => {
@@ -174,6 +183,7 @@
duration: 3000
})
setTimeout(res => {
uni.setStorageSync('refresh',true)
uni.navigateBack({})
}, 2000)
})

View File

@@ -0,0 +1,237 @@
<template>
<view class="NumberWeight">
<!-- 订单分类 -->
<view class="nav" >
<view :class="['nav-item' ,selectNavId === item.id?'nav-item-selected':'']" v-for="(item,index) in navList"
:key="index" @click="selectNav(item.id)">
{{item.name}}
{{item.id ==='signed' && count.signed >0 ? '('+count.signed + ')':''}}
{{item.id ==='completed' && count.completed >0 ?'('+count.completed + ')':''}}
{{item.id ==='init' && count.init >0 ?'('+count.init + ')':''}}
{{item.id ==='delivered' && count.delivered >0 ?'('+count.delivered + ')':''}}
</view>
</view>
<!-- 有订单列表 -->
<block v-if="lists.length > 0">
<!-- 订单列表 -->
<view class="order-list" v-for="(item,index) in lists" :key="index">
<MallShipmentsTemplate :item="item" />
<view class="actions">
<view class="nowPay" @click="goDetail(item.shipment_no)" >查看详情</view>
</view>
</view>
</block>
<!-- 没有订单列表 -->
<no-list v-if="lists.length === 0" name='no-order' txt="暂无数据~" />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import MallShipmentsTemplate from '@/components/mall-shipments-template/mall-shipments-template'
import { mallShipmentsPostShop , mallShipmentsSign , mallShipmentsCancel } from '@/apis/interfaces/numberWeight'
export default {
components: {
MallShipmentsTemplate
},
data() {
return {
lists: [],
page:1,
total:0,
navList: [],
type:'',// post 快递单 空为自提单
selectNavId: 'signed',
count:{},// 订单数量
};
},
onLoad(e) {
this.navList = [
{
name: '已使用',
id: 'signed'
},
{
name: '已完成',
id: 'completed'
}
]
this.selectNavId = 'signed'
this.getList()
},
onShow(){
console.log(uni.getStorageSync('refresh'),'getStorageSync')
if(uni.getStorageSync('refresh')){
this.reset()
}
},
onUnload() {
uni.setStorageSync('refresh',false)
},
onReachBottom() {
if(this.total>this.lists.length){
this.page = this.page + 1
this.getList()
}else{
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
duration: 3000
})
}
},
methods: {
reset(){
this.page =1
this.total = 0
this.lists = []
this.getList()
uni.setStorageSync('refresh',false)
},
// 选择订单
selectNav(id) {
if (this.selectNavId !== id) {
this.selectNavId = id
this.reset()
}
},
// 获取订单列表
getList(){
let data = {
pageSize:4,
page:this.page,
state:this.selectNavId
}
let apiUrl = ''
apiUrl = 'mall/shipments/service'
data.channel = 'app'
mallShipmentsPostShop(apiUrl,data).then(res=>{
console.log(res.count)
this.count = res.count
this.lists = this.lists.concat(res.lists.data)
this.total = res.lists.page.total
}).catch(err=>{
this.$refs.uToast.show({
title: err.message,
duration: 3000
})
})
},
// 查看详情
goDetail(no){
uni.navigateTo({
url:'/pages/property/order/servicesOrderInfo?no='+no
})
}
}
}
</script>
<style lang="scss" scoped>
page {
width: 100%;
height: 100%;
}
.NumberWeight {
width: 100%;
min-height: 100vh;
box-sizing: border-box;
background-color: #F7F7F7;
// 订单nav
.nav {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
box-sizing: border-box;
font-size: $title-size*0.95;
padding: 0 30rpx;
background-color: #fff;
color: #666;
border-top: solid 20rpx #f7f7f7;
position: sticky;
top: 0rpx;
z-index: 10000;
.nav-item {
border-bottom: solid 4rpx #fff;
padding: 30rpx 10rpx;
}
.nav-item-selected {
border-bottom: solid 4rpx $main-color;
color: $main-color;
}
}
// 订单列表
.order-list {
background-color: #fff;
border-radius: 20rpx;
min-height: 300rpx;
margin: 30rpx 20rpx 0 20rpx;
padding:30rpx 30rpx 20rpx 30rpx ;
// border-top: solid 4rpx #cacaca;
// 操作信息
.actions {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
flex-wrap: wrap;
flex: 1;
font-size: 28rpx;
color: #fff;
border-top: solid 1rpx #EFF4F2;
.nowPay {
padding: 4rpx 20rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
// background-color: $main-color;
color: #999;
border:solid 1rpx #cacaca;
}
.cancelOrder {
padding: 10rpx 30rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
background-color: #DD524D;
}
.logistics {
background-color: $main-color;
padding: 10rpx 30rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
}
.sign {
background-color: #DD524D;
padding: 10rpx 30rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
}
.evaluate {
background-color: $main-color;
padding: 10rpx 30rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,594 @@
<template>
<view class="OrderInfo" v-if="loaded">
<!-- 订单状态 -->
<view class="order-status">
<view class="info">
{{info.state_text}}
<span>您的快递正在坐着火箭朝您飞来</span>
</view>
<image src="/static/imgs/fire.png" mode="widthFix"></image>
</view>
<!-- 收货人 -->
<view class="acceptInfo" v-if="type === '1'">
<block>
<view class="name">{{address.name}} <span>{{address.mobile}}</span> </view>
<view class="address">
<u-icon name="map" color="red"></u-icon>
<span>{{address.full_address}}</span>
</view>
</block>
</view>
<view class="goods-info1">
<view class="top">
<view class="company">
<view class="company-logo">
<image :src="info.shop.cover" mode="aspectFill" />
<view class="name ellipsis">{{info.shop.name}}</view>
</view>
<view class="flexrow">
<view class="no ellipsis">发货单号 {{info.shipment_no}}</view>
</view>
</view>
</view>
<view class="goods-info">
<image class="goods-img" :src="info.goods_sku.cover" mode="aspectFill" />
<view class="goods">
<view class="name">
<view class="name1 ellipsis-2">{{info.goods_sku.goods_name}}</view>
<!-- <span>16.80</span> -->
</view>
<view class="sku">权证个数 <span>x {{info.qty}}</span> </view>
</view>
</view>
<navigator class="total" hover-class="none" :url='"/pages/goods/details?id="+info.goods_sku.goods_id'>
<view class="total-btn">再次购买</view>
</navigator>
<view class="goods-type">使用时间 <span>{{info.created_at}}</span></view>
<view class="goods-type">使用数量 <span> x {{info.qty}}</span></view>
<view class="goods-type">使用方式<span>门店使用</span>
</view>
<view class="goods-type-1" v-if="type === '2'">
提货门店
<view class="goods-type-address">
<view class="list-top1">
<image :src="info.store.cover.showpath" @click="map(info.store)" mode="aspectFill"
class="list-top1-img" />
<view class="shop-info shop-info1">
<view class="title ellipsis">{{info.store.name}}</view>
<view class="des" style="padding-top: 16rpx;">营业时间{{info.store.start_time}}</view>
<view class="des" style="padding-top: 4rpx;" @click="call(info.store.mobile)">
联系电话{{info.store.mobile}}</view>
<view class="des" style="padding-top: 4rpx;" @click="map(info.store)">
门店地址{{info.store.address}}</view>
</view>
</view>
</view>
</view>
</view>
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
mallShipmentsInfo
} from '@/apis/interfaces/numberWeight'
export default {
name: 'OrderInfo',
data() {
return {
info: {},
list: [{
name: '快递',
disabled: true,
id: '1'
},
{
name: '自提',
disabled: false,
id: '2'
}
],
address: {},
type: '1', //提货类型2 自提 1 邮寄
showStoreList: false, // 默认false不显示优惠券弹窗列表
store_id: '', // 默认没有选择任何一个优惠券
store_Name: '', // 门店名称
qty: 1,
loaded: false,
shipment_no: '', // 提货单no
};
},
onLoad(e) {
console.log(e)
this.shipment_no = e.no
this.getInfo(e.no)
console.log(this.shipment_no)
// this.getInfo('2021081817410747800300000004')
},
onShow() {
if (uni.getStorageSync('refresh')) {
this.getInfo(this.shipment_no)
}
},
methods: {
getInfo(shipment_no) {
mallShipmentsInfo(shipment_no).then(res => {
this.info = res
this.address = res.express
this.type = res.type + ''
this.loaded = true
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
call(e) {
uni.makePhoneCall({
phoneNumber: e
})
},
map(info) {
console.log(info.latitude, info.longitude)
uni.openLocation({
latitude: Number(info.latitude),
longitude: Number(info.longitude),
success: function() {
console.log('success');
}
});
}
}
}
</script>
<style lang="scss" scoped>
page {
width: 100%;
height: 100%;
}
.OrderInfo {
width: 100%;
min-height: 100vh;
box-sizing: border-box;
background-color: #F7F7F7;
padding-bottom: 80rpx;
.order-status {
width: 100%;
height: 300rpx;
background-image: linear-gradient(to bottom, $main-color, $main-color-light);
color: #Fff;
font-size: 36rpx;
padding: 30rpx 50rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.info {
font-size: 36rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
box-sizing: border-box;
span {
font-size: 28rpx;
padding-top: 30rpx;
}
}
image {
width: 200rpx;
}
}
.acceptInfo {
margin: 0 30rpx;
background-color: #fff;
box-shadow: 0 0 14rpx 4rpx rgba($color: $main-color, $alpha: 0.2);
border-radius: 20rpx;
padding: 30rpx;
position: relative;
top: -30rpx;
.name {
font-size: 36rpx;
font-weight: 600;
span {
padding-left: 20rpx;
font-size: 30rpx;
}
}
.address {
padding-top: 20rpx;
font-size: 28rpx;
span {
margin-left: 10rpx;
}
}
}
.goods-info1 {
padding: 20rpx 40rpx;
background-color: #fff;
.goods-type {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 30rpx 0;
border-bottom: solid 1rpx #f7f7f7;
}
.goods-type-1 {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
box-sizing: border-box;
padding: 30rpx 0;
border-bottom: solid 1rpx #f7f7f7;
}
.goods-type-address {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
u-icon {
padding-left: 20rpx;
}
}
// 顶部信息
.top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 30rpx 0;
border-bottom: solid 1rpx #EFF4F2;
.company-logo {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
image {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin-right: 20rpx;
}
.name {
width: 600rpx;
font-size: 30rpx;
color: #484848;
font-weight: bold;
}
}
.no {
margin-top: 16rpx;
font-size: $title-size*0.8;
color: #999;
// width: 500rpx;
}
.status {
color: #999;
font-size: $title-size;
}
}
// 商品信息
.goods-info {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
margin-top: 40rpx;
.goods-img {
width: 120rpx;
height: 120rpx;
border-radius: 10rpx;
}
.goods {
flex: 1;
margin-left: 20rpx;
.name {
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
box-sizing: border-box;
font-size: 30rpx;
// font-weight: bold;
.name1 {
width: 500rpx;
}
span {
font-size: 34rpx;
font-weight: normal;
}
}
.sku {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
margin-top: 10rpx;
font-size: 28rpx;
color: #999;
}
}
}
// 合计信息
.total {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
font-size: 26rpx;
color: $main-color;
flex: 1;
text-align: right;
margin-top: 20rpx;
padding-bottom: 30rpx;
}
.total-btn {
border: solid 1rpx $main-color;
padding: 6rpx 20rpx;
border-radius: 10rpx;
}
}
// 操作信息
.actions {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
flex-wrap: wrap;
background-color: #fff;
flex: 1;
font-size: 28rpx;
padding: 20rpx 50rpx 30rpx 50rpx;
color: #fff;
.nowPay {
padding: 4rpx 20rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
// background-color: $main-color;
color: #999;
border: solid 1rpx #cacaca;
}
.cancelOrder {
padding: 10rpx 30rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
background-color: #DD524D;
}
.logistics {
background-color: $main-color;
padding: 10rpx 30rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
}
.sign {
background-color: #DD524D;
padding: 10rpx 30rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
}
.evaluate {
background-color: $main-color;
padding: 10rpx 30rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
}
}
}
.flexrow {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 100%;
.copy {
color: $main-color;
font-size: $title-size*0.8;
font-weight: 400;
padding: 0 30rpx;
}
}
.no-address {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
// 优惠券弹窗
.scrollView {
// padding: 40rpx;
box-sizing: border-box;
position: relative;
// 标题
.coupon-title {
padding: 40rpx;
font-weight: bold;
font-size: 40rpx;
border-bottom: solid 1rpx #f7f7f7;
}
// 优惠券样式
.coupon-list-item {
border-bottom: solid 1rpx #f7f7f7;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
position: relative;
width: 100%;
.coupon-list-item {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba($color: #000, $alpha: 0);
z-index: 10001;
}
}
}
.list-top1 {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
box-sizing: border-box;
font-size: $title-size*0.94;
width: 100%;
margin-left: 0 !important;
margin-top: 30rpx;
.shop-info {
margin-left: 20rpx;
}
.list-top1-img {
width: 170rpx;
height: 170rpx;
border-radius: 10rpx;
}
.des {
font-size: 28rpx;
}
.title {
font-size: 32rpx;
}
}
.list-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 30rpx 0;
font-size: $title-size*0.94;
border-bottom: solid 1rpx #f7f7f7;
width: 600rpx;
margin-left: 30rpx;
.list-top-left {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.shop-info {
flex: 1;
}
.title {
width: 380rpx;
font-size: $title-size*1;
font-weight: 400;
}
.urate {
padding: 10rpx 0;
}
.des {
// padding-top: $padding*0.8;
font-size: $title-size * 0.8;
color: #999;
span {
color: #666;
padding: 0 10rpx;
}
}
.list-banner {
width: 120rpx;
margin-right: $margin*1.5;
height: 120rpx;
border-radius: 4rpx;
}
}
.list-top-right {
border: solid 1rpx $main-color;
color: $main-color;
display: inline-block;
padding: 8rpx 16rpx;
font-size: $title-size *0.8;
border-radius: 4rpx;
}
}
</style>

326
pages/property/record.vue Normal file
View File

@@ -0,0 +1,326 @@
<template>
<view class="Record">
<view class="record-top">
<image src="/static/images/record_bg.png" mode="widthFix" class="record-bg" />
<view class="record-top-nav">
<view :class="['record-top-item',type==='year'?'selectTopItem':'']" @click="selectType('year')">年账单</view>
<view :class="['record-top-item',type==='month'?'selectTopItem':'']" @click="selectType('month')">月账单</view>
<view :class="['record-top-item',type==='day'?'selectTopItem':'']" @click="selectType('day')">日账单</view>
</view>
<view class="record-mouth-year">
<view class="record-type-left">
<u-picker mode="time" v-model="show" :params="params" @confirm ='confirm' title ='筛选日期' start-year='2021' :end-year='currentYear'/>
<view @click="show = true">
{{date?date:'选择日期'}}
<uni-icons type="arrowdown" color="#fff" size="12" />
</view>
</view>
<view class="record-type-right">
<view :class="['pay_type_item',cointype==='in'?'pay_type_item_select':'']" @click="selectCoinType('in')">收入</view>
<view :class="['pay_type_item',cointype==='out'?'pay_type_item_select':'']" @click="selectCoinType('out')">支出</view>
</view>
</view>
<view class="record-title">可用额度</view>
<view class="record-money"><span></span>{{account}}</view>
<!-- <view class="">待解锁额度</view>
<view class="">授信额度</view> -->
</view>
<!-- 列表 -->
<view class="record-list" v-if="lists.length>0">
<view class="record-list-item" v-for="(item,index) in lists" :key='index'>
<view class="record-list-item-top">
<view class="title">{{item.note}}</view>
<view class="money">{{cointype==='in'?'+':'-'}}{{item.amount}}</view>
</view>
<view class="record-list-item-date">{{item.blockTime}}</view>
</view>
</view>
<!-- 无列表 -->
<no-list v-if="lists.length === 0 && cointype === 'in'" name='no-in' txt="没有任何收入记录" />
<no-list v-if="lists.length === 0 && cointype === 'out'" name='no-out' txt="没有任何支出记录" />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {chaineb} from '@/apis/interfaces/mine';
export default {
data() {
return {
lists:[],
has_next_page:true,
page:1,
type:'year', // 统计类型day日month月year年
cointype:'in',// in 收入 out 支出
date:new Date().toISOString().slice(0,4), // 日Y-m-d月Y-m年Y
params: {
year: true,
month: true,
day: true
},
show: false, // 显示
currentDay:new Date().toISOString().slice(0,10),
currentMonth:new Date().toISOString().slice(0,7),
currentYear:new Date().toISOString().slice(0,4),
account:''
}
},
onLoad(){
this.getList()
},
onReachBottom(){
if (this.has_next_page) {
this.page = this.page + 1
this.getList()
} else {
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
type: 'error',
icon:false,
duration: 3000
})
}
},
methods: {
// 获取列表
getList(){
let data = {
page:this.page,
type:this.type,
date:this.date,
cointype:this.cointype
}
chaineb(data).then(res => {
console.log(res)
this.account = res.account
this.lists = this.lists.concat(res.lists)
this.has_next_page = res.has_next_page
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'error',
icon:false,
duration: 3000
})
})
},
selectCoinType(type){
if(this.cointype !== type){
this.cointype = type
this.reset()
}
},
// 重置
reset(){
this.page = 1
this.lists = []
this.has_next_page = true
this.getList()
},
// 选择 年 月 日 切换要重置数据
selectType(type){
console.log(type,typeof type)
if(this.type !== type){
switch(type){
case 'year':
this.type = type
this.params= {
year: true,
month: false,
day: false
}
this.date = this.currentYear
this.reset()
break;
case 'month':
this.type = type
this.params= {
year: true,
month: true,
day: false
}
this.date = this.currentMonth
this.reset()
break;
case 'day':
this.type = type
this.params= {
year: true,
month: false,
day: false
}
this.date = this.currentDay
this.reset()
break;
}
}
},
// 点击确认按钮
confirm(e){
let type = this.type
switch(type){
case 'year':
this.date = e.year
this.reset()
break;
case 'month':
this.date = e.year + '-' + e.month
this.reset()
break;
case 'day':
this.date = e.year + '-' + e.month + '-' + e.day
this.reset()
break;
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f7f7f7;
}
.Record {
width: 100%;
height: 100vh;
padding-top: 30rpx;
}
.record-top {
width: calc(100% - 60rpx);
height: 360rpx;
background-image: linear-gradient(to left, #f40c50 , #f40c50);
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: $main-color, $alpha: 0.4);
margin: 0 30rpx;
border-radius: 20rpx;
box-sizing: border-box;
position: relative;
padding: 10rpx 50rpx 20rpx 50rpx;
z-index: 1;
.record-bg {
position: absolute;
width: 230rpx;
bottom: 0;
right: 30rpx;
z-index: 1;
}
.record-top-nav {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.record-top-item {
margin: 40rpx 20rpx;
font-size: 30rpx;
font-weight: 500;
color: #fff;
}
.selectTopItem{
border-bottom: solid 4rpx #fff;
}
}
.record-mouth-year {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
position: relative;
z-index: 2;
color: #fff;
font-size: 30rpx;
.record-type-left {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
uni-icons {
margin-left: 4rpx;
}
}
.record-type-right {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
font-size: 24rpx;
.pay_type_item {
margin: 0 10rpx;
padding: 2rpx 20rpx;
border-radius: 30rpx;
border: solid 1rpx rgba($color: #000000, $alpha: 0);
}
.pay_type_item_select{
border: solid 1rpx #f7f7f7;
}
}
}
.record-title {
font-size: 28rpx;
color: #fff;
padding: 20rpx 0;
}
.record-money {
color: #fff;
font-size: 50rpx;
font-weight: bold;
span {
font-size: 30rpx;
font-weight: 400;
margin-right: 4rpx;
}
}
}
.record-list {
padding: 20rpx 30rpx;
.record-list-item {
padding: 20rpx 0;
border-bottom: solid 1rpx #f7f7f7;
.record-list-item-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.title {
font-size: 30rpx;
width: 500rpx;
}
.money {
color: #f40c50;
font-size: 34rpx;
font-weight: bold;
}
}
.record-list-item-date {
font-size: 24rpx;
color: #a6a6a6;
margin-top: 10rpx;
}
}
}
</style>

View File

@@ -0,0 +1,272 @@
<template>
<view class="Mine">
<!-- 更多管理 -->
<view class="list">
<view class="list-item" @click="updImgs">
<view class="list-item-left">
<image src="/static/images/user-avatar.png" mode="widthFix" />
<span>修改头像</span>
</view>
<view class="avatar" >
<image :src="avatar.showPath" mode="aspectFill" />
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
</view>
</view>
<view class="list-item">
<view class="list-item-left">
<image src="/static/images/mine-self-name.png" mode="widthFix" />
<span>修改昵称</span>
</view>
<view class="input">
<input type="text" :value="nickname" @blur='blur' placeholder="请输入用户的昵称" maxlength="12" />
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
</view>
</view>
<view @click="loginOut" class="list-item">
<view class="list-item-left">
<image src="/static/images/reset-info.png" mode="widthFix" />
<span>切换账户</span>
</view>
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
</view>
</view>
<!-- 底部banner -->
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
getUserSettingInfo,
resetUserInfo
} from '@/apis/interfaces/mine'
import {
uploads
} from '@/apis/interfaces/uploading'
export default {
data() {
return {
canLogin: true,
nickname: '',
avatar: {
path: '',
showPath: ''
},
is_bind: true
}
},
onShow() {
this.getUserInfo()
},
onPullDownRefresh() {
this.getUserInfo()
},
methods: {
// 获取当前用户得基本信息
getUserInfo() {
getUserSettingInfo().then(res => {
this.avatar.showPath = res.avatar
this.nickname = res.nickname
this.is_bind = res.is_bind
uni.stopPullDownRefresh()
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
loginOut() {
uni.removeStorageSync('token')
uni.reLaunch({
url: '/pages/login/login'
})
},
// 上传头像
updImgs(type) {
uni.chooseImage({
success: res => {
let path = res.tempFiles.map((val, index) => {
return {
name: 'uploads' + index,
uri: val.path
}
})
uploads(path).then(pathRes => {
console.log(pathRes)
this.avatar.path = pathRes.path[0]
this.avatar.showPath = pathRes.url[0]
this.resetUserInfo('avatar',pathRes.url[0])
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}
})
},
// 修改姓名
blur(e){
let value = e.detail.value
console.log(value)
console.log(this.nickname)
if(value !== this.nickname){
this.resetUserInfo('nickname',value)
}
},
// 修改头像或昵称
resetUserInfo(key, value) {
let data ={
key:key,
value:value
}
resetUserInfo(data).then(res=>{
uni.showToast({
title: res,
icon: 'none'
})
this.getUserInfo()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #F8F8F8;
}
.Mine {
width: 100%;
height: 100%;
position: relative;
background-color: #fff;
// 更多管理
.list {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
position: relative;
top: -10rpx;
border-radius: 20rpx;
margin: 0 40rpx;
padding: 30rpx 0;
width: calc(100% - 80rpx);
button::after {
border: none;
background-color: none;
}
button {
position: relative;
display: block;
margin-left: auto;
margin-right: auto;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
font-size: $title-size *0.9;
text-align: center;
text-decoration: none;
line-height: 1;
border-radius: 5px;
-webkit-tap-highlight-color: transparent;
overflow: hidden;
color: #333;
background-color: #fff;
}
.list-item {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 40rpx 0;
border-bottom: solid 1rpx #f7f7f7;
box-sizing: border-box;
.avatar {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
image {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
margin-right: 20rpx;
}
}
.input {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
text-align: right;
flex: 1;
input {
padding-right: 30rpx;
width: 100%;
}
}
.list-item-left {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
image {
width: 40rpx;
}
span {
margin-left: 20rpx;
}
}
}
}
// 底部轮播图跳转到其他app
.mine-banner {
position: relative;
width: calc(100% - 80rpx);
top: -20rpx;
margin: 0 40rpx;
box-sizing: border-box;
margin-top: $margin*2;
}
}
.loginOut {
margin: 30rpx 50rpx;
background-color: #fff;
box-shadow: 0 0 20rpx 4rpx rgba($color: $main-color, $alpha: 0.1);
text-align: center;
padding: 20rpx;
border-radius: 10rpx;
color: #353535;
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<view>
权账户
账户
</view>
</template>

View File

@@ -1,19 +1,402 @@
<template>
<view>
优惠券核销
<view class="Verification">
<image class="top-img" src="/static/images/hexiao_bg.png" mode="widthFix" />
<view class="txt">
<view class="title">扫描券码和权证 一键核销</view>
<view class="des">降低核销门槛 <span class='dian'>·</span>低成本留存优质客户</view>
</view>
<view class="btn">
<view class="goods" @click="scanCode('goods','get')"> 权证核销 </view>
<view class="coupons" @click="scanCode('coupons','get')"> 优惠券核销 </view>
</view>
<view class="history">核销记录</view>
<u-toast ref="uToast" />
<!-- 二维码展示动画效果 -->
<view class="showCode " v-if="showCode">
<view class="showCodeBg" @click="showCode = false"></view>
<view :class="['showCodeContent', showCode?'showCodeContentSelect':'showCodeContentSelectNo']">
<view class="showCodeTitle"> {{scanType === 'goods'?'确认核销该权证':'确认核销该优惠券'}}</view>
<view class="goodsInfo" v-if="scanType === 'goods'">
<image class="left" :src="info.goods.cover" mode="widthFix" />
<view class="right">
<view class="title ellipsis-2">{{info.goods.goods_name}}</view>
<view class="number">核销数量: X {{info.qty}}</view>
</view>
</view>
<view class="goodsInfo" v-else>
<view class="right">
<view class="title ellipsis-2">优惠券名称 {{info.coupon.title}} </view>
<view class="number">
优惠券类型{{info.coupon.type.text}}
<span style='padding-left: 20rpx;'>数量1</span>
</view>
<view class="number">备注{{info.coupon.remark}}</view>
</view>
</view>
<view class="sureVer" @click="scanInfo(code,'post',)">确认核销</view>
<view class="showCodeDes">请谨慎核销,操作成功后无法撤回</view>
</view>
</view>
</view>
</template>
<script>
import {
scanInfo
} from '@/apis/interfaces/scan'
export default {
data() {
return {
scanType: 'goods', // coupons 优惠券核销 goods 权证核销
showCode: false,
info: '', // 权证核销返回前置
code: '', // 扫码返回的code
};
},
onLoad() {
uni.hideLoading()
},
methods: {
scanCode(e) {
console.log(e)
this.scanType = e
uni.scanCode({
success: (res) => {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
// uni.showLoading({
// title: '核销请求中..'
// })
this.code = res.result
this.scanInfo(res.result, 'get')
}
});
},
// 请求核销前置,优惠券前置和权证前置
scanInfo(token, method) {
console.log(token, this.scanType)
let apiUrl = ''
let data = {
code: token
}
if (this.scanType === 'goods') {
console.log('权证核销')
apiUrl = 'manages/warrants/verification'
} else {
console.log('优惠券核销!')
apiUrl = 'coupons/verify/coupon'
}
scanInfo(apiUrl, data, method).then(res => {
if (this.scanType === 'goods') {
uni.hideLoading()
if (method === 'post') {
this.showCode = false
this.$refs.uToast.show({
title: '权证核销成功',
type: 'error',
icon: false,
duration: 3000
})
} else {
this.showCode = true
this.info = res
}
} else {
console.log('优惠券核销 有商品跳转优惠券详情页面,没有商品直接弹出核销页面!')
console.log(res, 'res')
if (method === 'post') {
this.showCode = false
this.$refs.uToast.show({
title: '优惠券核销成功',
type: 'error',
icon: false,
duration: 3000
})
} else {
if (res.goods.length > 0) {
uni.showModal({
title: '温馨提示',
content: '该优惠券下绑定了商品,是否勾选相应商品',
success: (res1) => {
if (res1.confirm) {
uni.navigateTo({
url:'/pages/property/coupon/canUseList?code='+this.code
})
} else {
this.showCode = true
this.info = res.info
}
}
})
} else {
this.showCode = true
this.info = res.info
}
}
}
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'error',
icon: false,
duration: 3000
})
this.showCode = false
})
}
}
}
</script>
<style lang="scss">
.Verification {
width: 100%;
min-height: 100vh;
background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.top-img {
margin-top: 100rpx;
}
.txt {
padding-top: 120rpx;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.title {
font-size: 42rpx;
font-weight: 500;
}
.des {
font-size: 34rpx;
color: rgba($color: #255a7c, $alpha: .4);
padding-top: 20rpx;
font-weight: bold;
.dian {
color: #039bfe;
padding: 0 10rpx;
}
}
}
.btn {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
margin-top: 140rpx;
.goods,
.coupons {
width: 310rpx;
height: 90rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
border-radius: 8rpx;
border: solid 1rpx #039bfe;
color: #039bfe;
font-size: 34rpx;
font-weight: bold;
}
.coupons {
background-color: #039bfe;
color: #fff;
margin-left: 30rpx;
}
}
.history {
text-align: center;
padding: $padding;
width: 100%;
color: #cacaca;
}
}
// 动画效果
.showCode {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
z-index: 1;
.showCodeBg {
background-color: rgba($color:#000, $alpha: 0.3);
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 2;
}
.showCodeContentSelect {
animation: sk-foldCubeAngle .6s linear both;
}
.showCodeContentSelectNo {
animation: sk-foldCubeAngleNo .6s linear both;
}
.showCodeContent {
padding: 50rpx 30rpx 30rpx 30rpx;
width: 640rpx;
min-height: 500rpx;
background-color: #fff;
border-radius: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 30rpx;
position: relative;
z-index: 199;
image {
width: 60%;
}
.showCodeTitle {
font-weight: bold;
padding-bottom: 20rpx;
font-size: 40rpx;
margin-bottom: 20rpx;
margin-top: 30rpx;
}
.goodsInfo {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
margin: $margin;
// background-color:red;
.left {
width: 200rpx;
height: 200rpx;
margin-right: 20rpx;
border-radius: 2rpx;
}
.right {
flex: 1;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
.title {
font-size: 30rpx;
font-weight: bold;
}
.number {
padding-top: 10rpx;
color: #999;
}
}
}
.sureVer {
background-color: #039bfe;
width: 500rpx;
height: 90rpx;
border-radius: 8rpx;
color: #fff;
margin: 30rpx 0;
font-size: 40rpx;
font-weight: bold;
text-align: center;
line-height: 90rpx;
}
.showCodeDes {
padding: 20rpx 0 20rpx 0;
color: gray;
font-size: 24rpx;
}
}
@keyframes sk-foldCubeAngle {
0% {
-webkit-transform: perspective(140px) rotateX(-180deg);
transform: perspective(140px) rotateX(-180deg);
opacity: 0;
}
100% {
-webkit-transform: perspective(140px) rotateX(0deg);
transform: perspective(140px) rotateX(0deg);
opacity: 1;
}
}
@keyframes sk-foldCubeAngleNo {
0% {
transform: scale(1);
opacity: 1;
}
25% {
transform: scale(0);
opacity: 0;
}
}
@keyframes turn {
0% {
-webkit-transform: rotate(0deg);
opacity: 1;
}
25% {
-webkit-transform: rotate(90deg);
opacity: .9;
}
50% {
-webkit-transform: rotate(180deg);
opacity: .8;
}
75% {
-webkit-transform: rotate(270deg);
opacity: .9;
}
100% {
-webkit-transform: rotate(360deg);
opacity: 1;
}
}
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
static/images/hexiao_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/images/record_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,25 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<script>
var __UniViewStartTime__ = Date.now();
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title>View</title>
<link rel="stylesheet" href="view.css" />
</head>
<body>
<div id="app"></div>
<script src="__uniappes6.js"></script>
<script src="view.umd.min.js"></script>
<script src="app-view.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -1,154 +0,0 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length; i++) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length; j++) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/
/******/ return result;
/******/ }
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "app-config": 0
/******/ };
/******/
/******/ var deferredModules = [];
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/ var jsonpArray = this["webpackJsonp"] = this["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // run deferred modules from other chunks
/******/ checkDeferredModules();
/******/ })
/************************************************************************/
/******/ ([]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Some files were not shown because too many files have changed in this diff Show More