| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- <template>
- <view class="app-content">
- <view class="billing_box_bg">
- <view class="top-view"></view>
- <view class="result-view">
- <view :class="['iconfont', 'iconchenggong']"></view>
- <view class="result-title">下单成功</view>
- <button class="admin-button-com big" style="width:70vw;" @click="goDetail">订单详情</button>
- <button v-if="ghsCgScene!=''" class="admin-button-com big" style="width:70vw;margin-top:18upx;" @click="goHome">返回首页</button>
- <button v-else class="admin-button-com big" style="width:70vw;margin-top:18upx;" @click="goBack">返回</button>
- <view style="margin-top:15upx;" v-if="showFirstGuide">
- <view style="font-size:28upx;">微信下拉,搜索小程序 花掌柜,可再次买花</view>
- <view style="margin-bottom:30upx;margin-top:15upx;">
- <image style="width:70vw;" :src="`${constant.imgUrl}/cg/hd_cg_route3.png`" mode="widthFix"></image>
- </view>
- </view>
- <view style="margin-top:10upx;" v-else>
- <view style="margin-bottom:10upx;margin-top:10upx;">
- <image style="width:86vw;" :src="`${constant.imgUrl}/cg/hd_cg_route4.png`" mode="widthFix"></image>
- </view>
- </view>
- </view>
- <!-- #ifdef MP-WEIXIN -->
- <view style="width:690upx;height:25upx;background-color: #f5f5f5;"></view>
- <ad-custom unit-id="adunit-b3f48f1b6c1a39ff"></ad-custom>
- <!-- #endif -->
- </view>
- </view>
- </template>
- <script>
- import { getCgItemInfo } from "@/api/purchase";
- import { batchChangePrice } from '@/api/product';
- import { mapGetters } from "vuex";
- import { CURRENT_ENV } from "@/config";
- export default {
- name: "AppResult",
- data() {
- return {
- hasInit:false,
- ghsCgScene:'',
- currentEnv:'production',
- fromCg:0,
- flowersList:[],
- onlyCg:1,
- showFirstGuide:true
- }
- },
- onLoad () {
- this.hasInit = true
- const storageKey = 'particularsVisitCount'
- let visitCount = Number(uni.getStorageSync(storageKey) || 0) + 1
- uni.setStorageSync(storageKey, visitCount)
- this.showFirstGuide = visitCount <= 3
- //供货商打开太阳码分享给客户,客户需要采购进来
- let scene = uni.getStorageSync('ghsCgScene')
- if(scene){
- this.ghsCgScene = scene
- }
- //供货商打开小程序分享给客户,客户需要采购进来
- let ghsCgOption = uni.getStorageSync('ghsCgOption')
- if(ghsCgOption.fromCg){
- this.fromCg = ghsCgOption.fromCg
- }
- this.getCgItemFn()
- //当前环境
- this.currentEnv = CURRENT_ENV
- },
- onShow () {
- if(this.hasInit == false){
- this.$store.commit("setLoginInfo", {})
- }
- },
- computed: {
- ...mapGetters(['getDictionariesInfo']),
- },
- methods: {
- init(){
- },
- commit(){
- let that = this
- let hasError = false
- let name = ''
- this.flowersList.forEach((ele)=>{
- if(this.$util.isMoney(ele.changePrice) == false || Number(ele.changePrice)<0){
- hasError = true
- name = ele.name
- }
- })
- if(hasError){
- this.$msg('请填写 '+name+' 价格')
- return false
- }
- that.$util.confirmModal({content:'确认修改?'},() => {
- that.commitChange()
- })
- },
- commitChange(){
- let arr = this.flowersList.map((ele)=>{
- return {id:ele.productId,price:ele.changePrice}
- })
- let that = this
- uni.showLoading({mask:true})
- batchChangePrice({data:JSON.stringify(arr)}).then(res=>{
- if(res.code == 1){
- that.$msg('修改成功')
- }
- })
- },
- getCgItemFn(){
- let id = this.option.id ? this.option.id : 0
- let that = this
- getCgItemInfo({id:id}).then(res=>{
- if(res.code == 1){
- that.onlyCg = res.data.onlyCg
- let list = res.data.list ? res.data.list : []
- if(!this.$util.isEmpty(list)){
- let arr = list.map((ele)=>{
- return {...ele,changePrice:''}
- })
- that.flowersList = arr
- }
- }
- })
- },
- goBack(){
- uni.navigateBack()
- //this.subscribe()
- },
- goHome () {
- uni.removeStorageSync('ghsCgScene')
- uni.removeStorageSync('ghsCgOption')
- this.pageTo({url:"/admin/home/workbench",type:4})
- //this.subscribe()
- },
- goDetail() {
- uni.removeStorageSync('ghsCgScene')
- uni.removeStorageSync('ghsCgOption')
- this.pageTo({url: '/pagesPurchase/purDetails?id='+this.option.id+'&status=2',type:2})
- //this.subscribe()
- },
- subscribe(){
- // #ifdef MP-WEIXIN
- if(this.getDictionariesInfo && this.getDictionariesInfo.subscribeMessage && this.getDictionariesInfo.subscribeMessage == 1 && this.getDictionariesInfo.hdMiniMessage && this.getDictionariesInfo.hdMiniMessage.cgSuccess && this.getDictionariesInfo.hdMiniMessage.remindHdClear && this.getDictionariesInfo.hdMiniMessage.fhNotice){
- uni.requestSubscribeMessage({
- tmplIds: [this.getDictionariesInfo.hdMiniMessage.cgSuccess.msgId,this.getDictionariesInfo.hdMiniMessage.fhNotice.msgId,this.getDictionariesInfo.hdMiniMessage.remindHdClear.msgId],
- success(res) {
- console.log(res)
- },
- fail(err) {
- console.log(err)
- },
- complete() {
- }
- })
- }
- // #endif
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- .go-back{
- width: 80%;
- height: 80upx;
- color: #FFFFFF;
- margin-top: 50upx;
- background: #3385FF;
- border-radius: 10upx;
- font-size:30upx;
- }
- .title{
- font-weight:700;
- margin-bottom:30upx;
- font-size:30upx;
- }
- .product-area{
- width:730upx;
- height:90upx;
- display:flex;
- align-items:center;
- .first-area{
- border-bottom:1upx solid #e4e2e2;
- position:relative;
- width:550upx;
- .name{
- width:280upx;
- overflow: hidden;
- text-overflow:ellipsis;
- white-space: nowrap;
- display:inline-block;
- font-weight:bold;
- font-size:28upx;
- }
- .cg-cost{
- font-weight:bold;
- font-size:27upx;
- color:red;
- position:absolute;
- left:480upx;
- top:8upx;
- }
- .cost-price{
- font-weight:bold;
- font-size:27upx;
- color:blue;
- position:absolute;
- left:515upx;
- top:18upx;
- }
- input{
- border:1upx solid #cccccc;
- display:inline-block;
- width:135upx;
- margin-left:10upx;
- margin-right:30upx;
- text-align:center;
- font-size:30upx;
- }
- }
- .second-area{
- float:left;
- color:#646464;
- margin-top:10upx;
- .one{
- color:red;
- }
- .two{
- color:#CCCCCC;
- }
- }
- }
- .billing_box_bg {
- position: relative;
- padding: 30upx 30upx 0upx 30upx;
- display: flex;
- flex-direction: column;
- background-color: #f5f5f5;
- .top-view {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 299upx;
- background: #3385ff;
- border-radius: 0upx 0upx 83upx 83upx;
- }
- .result-view {
- position: relative;
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 20upx 70upx 0upx 70upx;
- width: 100%;
- background: #ffffff;
- border-radius: 20upx 20upx 0upx 0upx;
- z-index: 1;
- .iconchenggong {
- font-size: 100upx;
- color: $mainColor1;
- }
- .result-title {
- margin: 20upx 0 30upx;
- font-size: 32upx;
- }
- .close_btn {
- line-height: 88upx;
- text-align: center;
- width: 550upx;
- height: 88upx;
- border: 1px solid #dddddd;
- border-radius: 8upx;
- font-size: 32upx;
- color: #666;
- }
- }
- .admin-button-com {
- margin-bottom: 20upx;
- width: 100%;
- }
- }
- </style>
|