123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844 |
- <template>
- <view>
- <view class="top-cont">
- <!-- 背景图片 -->
- <image class="bg" src="/static/images/order_top_bg.png" mode=""></image>
- <view class="top-inner">
- <!-- 这里是状态栏 -->
- <view class="fixed-top-box">
- <view class="status_bar" :style="{height: statusBarHeight}"></view>
- <view class="back-box" @click="back">
- <image src="../static/images/back_white.png" mode=""></image>
- <text class="title">订单详情</text>
- <text></text>
- </view>
- </view>
-
- <!-- 顶部固定后站位元素 -->
- <view style="padding-bottom: 88upx;">
- <view :style="{height: statusBarHeight}"></view>
- </view>
- <!-- 订单状态 -->
- <view class="order-status">
- <!-- 待付款 -->
- <view v-if="order.status == 0" class="inner">
- <view class="img-box">
- <image src="/static/images/pag96.png" mode=""></image>
- </view>
- <view class="status-box">
- <text class="status">待付款</text>
- <text class="desc">请在{{payLimitTime}}前完成支付</text>
- </view>
- </view>
- <!-- 待发货 -->
- <view v-if="order.status == 1" class="inner">
- <view class="img-box">
- <image src="/static/images/pag96.png" mode=""></image>
- </view>
- <view class="status-box">
- <text class="status">待发货</text>
- <text class="desc">等待后台发货</text>
- </view>
- </view>
- <!-- 已发货、待收货 -->
- <view v-if="order.status == 2" class="inner">
- <view class="img-box">
- <image src="/static/images/receipt.png" mode=""></image>
- </view>
- <view class="status-box">
- <text class="status">待收货</text>
- <text class="desc">运输中</text>
- </view>
- </view>
- <!-- 已完成 -->
- <view v-if="order.status == 3" class="inner">
- <view class="img-box">
- <image src="/static/images/finish96.png" mode=""></image>
- </view>
- <view class="status-box">
- <text class="status">已完成</text>
- <text class="desc">订单已确认收货,交易完成</text>
- </view>
- </view>
- <!-- 交易取消 -->
- <!--交易取消 -->
- <view v-if="order.status == -3" class="inner">
- <view class="img-box">
- <image src="/static/images/close_trade.png" mode=""></image>
- </view>
- <view class="status-box">
- <text class="status">交易关闭</text>
- <text class="desc">订单已取消</text>
- </view>
- </view>
- <view v-if="order.status == -1" class="inner">
- <view class="img-box">
- <image src="/static/images/close_trade.png" mode=""></image>
- </view>
- <view class="status-box">
- <text class="status">申请售后</text>
- <text class="desc">请等待客服审核</text>
- </view>
- </view>
- <view v-if="order.status == -2" class="inner">
- <view class="img-box">
- <image src="/static/images/close_trade.png" mode=""></image>
- </view>
- <view class="status-box">
- <text class="status">退款成功</text>
- <text class="desc">已成功退款</text>
- </view>
- </view>
- </view>
- <!-- 下单人信息 -->
- <view class="order-placer">
- <view class="inner">
- <image class="location" src="/static/images/location.png" mode=""></image>
- <view class="info">
- <view class="name-phone">
- <text class="text">{{order.realName}}</text>
- <text class="text" v-if="order.userPhone!=null">{{utils.parsePhone(order.userPhone)}}</text>
- </view>
- <view class="address ellipsis2">
- {{order.userAddress}}
- </view>
- </view>
- </view>
- </view>
- <view class="content">
- <!-- 商品列表 -->
- <view class="goods-list">
- <view v-if="order.isPackage!=1" v-for="(item,index) in items" :key="index" class="item">
- <view class="img-box">
- <image :src="JSON.parse(item.jsonInfo).image" mode="aspectFill"></image>
- </view>
- <view class="info-box">
- <view>
- <view class="name-box ellipsis2">
- <view v-if="item.isPrescribe==1" class="tag">处方药</view>{{JSON.parse(item.jsonInfo).productName}}
- </view>
- <view class="spec">{{JSON.parse(item.jsonInfo).sku}}</view>
- </view>
- <view class="price-num">
- <view class="price">
- <text class="unit">¥</text>
- <text class="num">{{JSON.parse(item.jsonInfo).price.toFixed(2)}}</text>
- </view>
- <view class="num">x{{JSON.parse(item.jsonInfo).num}}</view>
- </view>
- </view>
- </view>
- <view v-if="order.isPackage==1&&order.packageJson!=null" class="item">
- <view class="img-box">
- <image :src="JSON.parse(order.packageJson).imgUrl" mode="aspectFill"></image>
- </view>
- <view class="info-box">
- <view>
- <view class="name-box ellipsis2">
- <view class="tag">套餐</view>{{JSON.parse(order.packageJson).title}}
- </view>
- <view class="spec">{{JSON.parse(order.packageJson).descs}}</view>
- </view>
-
- </view>
- </view>
- <!-- 已优惠、小计 -->
- <view class="sub-total">
- <view class="discount">
- 订单金额:¥{{order.totalPrice}}
- </view>
- <text class="label">实付金额:</text>
- <view class="price">
- <text class="unit">¥</text>
- <text class="num">{{order.payPrice}}</text>
- </view>
- </view>
- </view>
- <!-- 订单信息 -->
- <view class="order-info">
- <view class="title">订单信息</view>
- <view class="item">
- <text class="label">订单编号</text>
- <view class="sn-box">
- <text class="text">{{order.orderCode}}</text>
- <view class="copy-btn" @click="copyOrderSn(order.orderCode)">复制</view>
- </view>
- </view>
- <view class="item">
- <text class="label">下单时间</text>
- <text class="text">{{order.createTime}}</text>
- </view>
- <view class="item">
- <text class="label">支付方式</text>
- <text class="text" v-if="order.payType==1">微信支付</text>
- <text class="text" v-if="order.payType==2">物流代收</text>
- </view>
- <view class="item">
- <text class="label">支付金额</text>
- <text class="text" v-if="order.payMoney!=null">¥{{order.payMoney.toFixed(2)}}</text>
- </view>
- <view class="item">
- <text class="label">代收金额</text>
- <text class="text" v-if="order.payDelivery!=null">¥{{order.payDelivery.toFixed(2)}}</text>
- </view>
- <view v-if="order.status>0" class="item">
- <text class="label">支付时间</text>
- <text class="text">{{order.payTime}}</text>
- </view>
- <!-- <view v-if="order.status >1" class="item">
- <text class="label">发货时间</text>
- <text class="text"></text>
- </view> -->
-
- </view>
- <!-- 处方信息 -->
- <view class="order-info" v-if="order.isPrescribe&&prescribe!=null">
- <view class="title">处方信息</view>
- <view class="item">
- <text class="label">处方单号</text>
- <text class="text">{{prescribe.rpId}}</text>
- </view>
- <view class="item">
- <text class="label">开方医生</text>
- <text class="text">{{prescribe.doctorName}}</text>
- </view>
- <view class="item">
- <text class="label">电子处方</text>
- <view class="check-box" @click="showImg()">
- <text class="text">查看</text>
- <image src="/static/images/arrow4.png" mode=""></image>
- </view>
- </view>
- </view>
- </view>
-
- </view>
- </view>
- <!-- 按钮 -->
- <view class="btn-box">
- <view class="btn share-btn" v-if="order.status==0">
- 支付分享
- <button class="share" data-name="shareBtn" open-type="share">分享</button>
- </view>
- <view class="btn share-btn" v-if="order.status==0" @click="openEditMoney()">
- 修改定金
- </view>
- </view>
-
- <view class="popup-box" v-if="editShow">
- <view class="info-mask" @tap="cancelEditMoney()" ></view>
- <view class="info-form" >
- <view class="title">修改订金</view>
- <view class="form-box">
- <view class="form-item">
- <text class="label">支付金额</text>
- <input type="text" @input="moneyChange()" v-model="payMoney" maxlength="10" placeholder="支付金额" class="form-input" />
- </view>
- <view class="form-item">
- <text class="label">代收金额</text>
- <input type="text" disabled v-model="payDelivery" maxlength="10" placeholder="代收金额" class="form-input" />
- </view>
- </view>
- <view class="btns">
- <view class="sub-btn" @click="confirmEditMoney()">提交</view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {getMyStoreOrderById } from '@/api/storeOrder'
- import {editOrderMoney} from '@/api/companyOrder.js'
- export default {
- data() {
- return {
- payMoney:0,
- payDelivery:0,
- editShow:false,
- payLimitTime:null,
- orderId:null,
- order:{},
- items:[],
- prescribe:null,
- // 状态栏的高度
- statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
-
- };
- },
- onLoad(option) {
- this.orderId = option.id
- this.getMyStoreOrderById()
- },
- onShareAppMessage(res) {
- // 针对单个订单,所以不用传组合combinationOrderId
- return {
- title: "订单:"+this.order.orderCode,
- path: `/pages/shopping/paymentOrder?orderId=${this.order.id}`,
- }
- },
- methods: {
- moneyChange(){
- this.payDelivery=this.order.payPrice-this.payMoney
- },
- openEditMoney(){
- console.log(1)
- this.editShow = true
- },
- cancelEditMoney(){
- this.editShow = false
- },
- confirmEditMoney(){
- if(parseFloat(this.payMoney)>=0){
- var that=this;
- var data={orderId:this.order.id,token:uni.getStorageSync('CompanyUserToken'),money:this.payMoney}
- editOrderMoney(data).then(
- res => {
- if(res.code==200){
- this.editShow = false
- this.getMyStoreOrderById();
- }else{
- uni.showToast({
- icon:'none',
- title: res.msg,
- });
- }
- },
- rej => {}
- );
-
- }
- else{
- uni.showToast({
- icon:'none',
- title: "支付金额应大于等于0",
- });
- }
- },
- showImg(){
- var imgArr = [];
- imgArr.push(this.prescribe.rpUrl)
- //预览图片
- uni.previewImage({
- urls: imgArr,
- current: imgArr[0]
- });
- },
- getMyStoreOrderById(){
- var data={orderId:this.orderId};
- getMyStoreOrderById(data).then(res => {
- if(res.code==200){
- this.order=res.order;
- this.items=res.items;
- this.payLimitTime=res.payLimitTime;
- this.prescribe=res.prescribe;
- this.payMoney=this.order.payMoney;
- this.payDelivery=this.order.payDelivery
- }else{
- uni.showToast({
- icon:'none',
- title: "请求失败",
- });
-
- }
- });
- },
- express(){
- uni.navigateTo({
- url: './storeOrderDelivery?orderId='+this.order.orderId
- })
- },
-
- // 返回上一页
- back() {
- uni.navigateBack()
- },
- // 复制订单编号
- copyOrderSn(text) {
- // 复制方法
- uni.setClipboardData({
- data:text,
- success:()=>{
- uni.showToast({
- title:'内容已成功复制到剪切板',
- icon:'none'
- })
- }
- });
- },
-
- }
- }
- </script>
- <style lang="scss">
- .fixed-top-box{
- width: 100%;
- background: linear-gradient(135deg, #66b2ef 0%, #018C39 100%);
- position: fixed;
- top: 0;
- left: 0;
- z-index: 1000;
- }
- .top-cont{
- width: 100%;
- height: 476upx;
- position: relative;
- .bg{
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1;
- }
- .top-inner{
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 2;
- .back-box{
- height: 88upx;
- padding-left: 22upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 20upx;
- image{
- width: 40upx;
- height: 40upx;
- }
- .title{
- font-size: 36upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- }
- }
- .order-status{
- margin-top: 60upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 30upx;
- .inner{
- display: flex;
- align-items: center;
- .img-box{
- width: 96upx;
- height: 96upx;
- margin-right: 30upx;
- image{
- width: 100%;
- height: 100%;
- }
- }
- .status-box{
- height: 96upx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- .status{
- font-size: 40upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- line-height: 1;
- }
- .desc{
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 1;
- margin-top: 30upx;
- }
- }
- }
- }
- .order-placer{
- margin-top: 50upx;
- padding: 0 20upx;
- .inner{
- box-sizing: border-box;
- border-radius: 16upx;
- height: 150upx;
- padding: 40upx 30upx;
- display: flex;
- align-items: center;
- background: #FFFFFF;
- .location{
- width: 24upx;
- height: 27upx;
- margin-right: 18upx;
- flex-shrink: 0;
- }
- .info{
- .name-phone{
- display: flex;
- align-items: center;
- .text{
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 1;
- margin-right: 20upx;
- &:last-child{
- margin-right: 0;
- }
- }
- }
- .address{
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 1.3;
- margin-top: 10upx;
- }
- }
- }
-
- }
- }
- }
- .content{
- margin: 20rpx 0rpx;
- padding: 0 20upx 140rpx 20upx;
- .goods-list{
- padding: 0 30upx;
- background-color: #FFFFFF;
- border-radius: 16upx;
- .item{
- padding: 30upx 0;
- border-bottom: 1px solid #EDEEEF;
- display: flex;
- align-items: center;
- .img-box{
- width: 160upx;
- height: 160upx;
- margin-right: 30upx;
- image{
- width: 100%;
- height: 100%;
- }
- }
- .info-box{
- width: calc(100% - 190upx);
- height: 160upx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .name-box{
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 40upx;
- .tag{
- display: inline-block;
- padding: 0 6upx;
- height: 30upx;
- background: linear-gradient(90deg, #66b2ef 0%, #018C39 100%);
- border-radius: 4upx;
- margin-right: 10upx;
- font-size: 22upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- line-height: 30upx;
- float: left;
- margin-top: 7upx;
- }
- }
- .spec{
- margin-top: 18upx;
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 1;
- }
- .price-num{
- display: flex;
- align-items: center;
- justify-content: space-between;
- .price{
- display: flex;
- align-items: flex-end;
- .unit{
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 1.2;
- margin-right: 4upx;
- }
- .num{
- font-size: 32upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 1;
- }
- }
- .num{
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 1;
- }
- }
- }
- }
- .sub-total{
- height: 88upx;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- .discount{
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 1;
- margin-right: 30upx;
- }
- .label{
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- .price{
- display: flex;
- align-items: flex-end;
- .unit{
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FF6633;
- line-height: 1.2;
- margin-right: 4upx;
- }
- .num{
- font-size: 32upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FF6633;
- line-height: 1;
- }
- }
- }
- }
- .order-info{
- margin-top: 20upx;
- background: #FFFFFF;
- border-radius: 16upx;
- padding: 40upx 30upx;
- .title{
- font-size: 30upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #222222;
- line-height: 1;
- }
- .item{
- margin-top: 40upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .label{
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 1;
- }
- .text{
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #222222;
- line-height: 32upx;
- }
- .cont-text{
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- .bold{
- color: #111111;
- }
- }
- .sn-box{
- display: flex;
- align-items: center;
- .copy-btn{
- width: 58upx;
- height: 32upx;
- line-height: 32upx;
- text-align: center;
- font-size: 22upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #222222;
- background: #F5F5F5;
- border-radius: 4upx;
- margin-left: 24upx;
- }
- }
- .check-box{
- display: flex;
- align-items: center;
- image{
- width: 14upx;
- height: 24upx;
- margin-left: 10upx;
- }
- }
- }
- .line{
- width: 100%;
- height: 1px;
- background: #F0F0F0;
- margin-top: 30upx;
- }
- }
- }
- .btn-box{
- z-index: 999;
- bottom: 0;
- width: 100%;
- position: fixed;
- height: 120upx;
- box-sizing: border-box;
- background: #FFFFFF;
- padding: 0 30upx;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- .btn{
- width: 155upx;
- height: 64upx;
- line-height: 64upx;
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- text-align: center;
- border-radius: 32upx;
- margin-left: 15upx;
- &.share-btn{
- background: #018C39;
- color: #FFFFFF;
- position: relative;
- .share{
- display: inline-block;
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%rpx;
- opacity: 0;
- }
-
- }
- }
- }
- .popup-box{
- position: fixed;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- z-index: 999;
- display: flex;
- justify-content: center;
- align-items: center;
- .info-mask {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- background-color: rgba($color: #000000, $alpha: 0.5);
- z-index: 999;
- }
- .info-form {
- z-index: 1000;
- width: 650rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 0 30upx;
- background: #FFFFFF;
- border-radius: 16upx;
- .title{
- padding: 30rpx 0rpx 15rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 40upx;
- line-height: 44upx;
- font-family: PingFang SC;
- color: #222222;
- }
- .form-box{
- width: 100%;
- .form-item{
- padding: 30upx 0;
- display: flex;
- align-items: flex-start;
- border-bottom: 1px solid #F1F1F1;
- .label{
- width: 160upx;
- text-align: left;
- font-size: 30upx;
- line-height: 44upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #222222;
- flex-shrink: 0;
- }
- input{
- text-align: left;
- }
- .form-input{
- font-size: 34upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #222222;
- text-align: left;
- }
-
- }
- }
- .btns{
- width: 100%;
- height: 120upx;
- padding: 0 30upx;
- display: flex;
- align-items: center;
- justify-content: center;
- .sub-btn{
- width: 100%;
- height: 88upx;
- line-height: 88upx;
- text-align: center;
- font-size: 30upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- background: #018C39;
- border-radius: 44upx;
- }
- }
-
- }
- }
- </style>
|