修复名片订单不跳转半屏小程序问题
修复地图点击进去定位问题
修复少了一个上传的按钮图标
2 files added
11 files modified
| | |
| | | public function delete() |
| | | { |
| | | $param = request()->param(); |
| | | if((new BusinessModel())->get(['business_card_id'=>$param['business_card_id'],'is_default'=>1])){ |
| | | if((new BusinessModel())->where(['business_card_id'=>$param['business_card_id'],'is_default'=>1])->find()){ |
| | | return $this->renderError('当前名片为默认名片,无法删除,可切换默认名片后进行删除'); |
| | | } |
| | | $model = (new BusinessModel())->where('business_card_id', $param['business_card_id'])->find(); |
| | |
| | | if((new SavingModel())->add($param)){ |
| | | return $this->renderSuccess(''); |
| | | } |
| | | return $this->renderError(); |
| | | return $this->renderError(''); |
| | | } |
| | | |
| | | /** |
| | |
| | | if ($params['use_balance'] == 1) { |
| | | $payment = $this->onPaymentByBalance($user, $order); |
| | | } elseif ($payType == OrderPayTypeEnum::WECHAT) { |
| | | $this->onPaymentByWechat($user, $order); |
| | | $payment = $this->onPaymentByWechat($user, $order); |
| | | } else { |
| | | return $this->renderError('支付方式错误'); |
| | | } |
| | |
| | | imagesavealpha($targetImage, true); |
| | | $bg = imagecolorallocatealpha($targetImage, 255, 255, 255, 127); |
| | | imagefill($targetImage, 0, 0, $bg); |
| | | imagecopyresampled($targetImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); |
| | | imagepng($targetImage, $imageUrl,0); // 根据需要选择合适的函数(如imagepng、imagegif等) |
| | | imagecopyresampled($targetImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); // 保存时使用最高质量 |
| | | $ext = pathinfo($imageUrl, PATHINFO_EXTENSION); |
| | | if ($ext == 'png'){ |
| | | imagepng($targetImage, $imageUrl,0); // 根据需要选择合适的函数(如imagepng、imagegif等) |
| | | }else{ |
| | | imagejpeg($targetImage, $imageUrl,100); |
| | | } |
| | | |
| | | // 清理内存 |
| | | imagedestroy($targetImage); |
| | | imagedestroy($image); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return array |
| | | */ |
| | | private function SizeLeftTop($fontSize,$left,$top){ |
| | | $data[0] = $fontSize * 0.76; |
| | | // 正确的px到pt转换系数:1px = 0.75pt |
| | | // 使用0.75而不是0.76以确保字体大小显示准确 |
| | | $data[0] = $fontSize * 0.75; |
| | | $data[1] = $left; |
| | | $data[2] = $top + $fontSize; |
| | | return $data; |
| | |
| | | 头像 |
| | | </view> |
| | | <view class="tx" style="margin-left: 30rpx;"> |
| | | <image class="logo" :src="file_path" mode="heightFix"></image> |
| | | <image class="logo" :src="file_path||'@/static/shop/login/qietu_1054.png'" mode="heightFix"></image> |
| | | <Upload v-if="is_avatar" @getImgs="handleAvatarUpload" :imageList="[file_path]"></Upload> |
| | | </view> |
| | | </view> |
| | |
| | | logo |
| | | </view> |
| | | <view class="logo" style="overflow: hidden;"> |
| | | <image class="logo" :src="logo_path" mode="heightFix"></image> |
| | | <image class="logo" :src="logo_path||'@/static/shop/login/qietu_1054.png'" mode="heightFix"></image> |
| | | <Upload v-if="is_logo" @getImgs="handleLogoUpload" :imageList="[logo_path]"></Upload> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="lxfx"> |
| | | <view class="lxfxbiaoti"><text style="color: #fa3534;">*</text>手机:</view> |
| | | <view class="lxfxnrr"> |
| | | <input @input="sjh" placeholder="输入手机号,多个手机号用/隔开" v-model="mobile" class="lxfxneirong" |
| | | <input @input="sjh" placeholder="输入手机号" v-model="mobile" class="lxfxneirong" |
| | | type="text"> |
| | | <input style="display: none;" name="mobile" v-model="business.mobile" |
| | | class="lxfxneirong" type="text"> |
| | |
| | | v-model="business.industry_id"> |
| | | </view> |
| | | </view> |
| | | <view class="lxfx"> |
| | | <view class="lxfx" > |
| | | <view class="lxfxbiaoti">所在地区:</view> |
| | | <view class="lxfxnrr"> |
| | | <input class="lxfxneirong" :value="selectCity" disabled="true" |
| | | @click="showMulLinkageThreePicker" placeholder="请选择省市区"> |
| | | @click="chooseLocation" placeholder="请选择省市区"> |
| | | <input style="display: none;" type="hidden" name="province_id" |
| | | v-model="business.province_id"> |
| | | <input style="display: none;" type="hidden" name="city_id" v-model="business.city_id"> |
| | |
| | | v-model="business.region_id"> |
| | | </view> |
| | | </view> |
| | | <view class="lxfx"> |
| | | <view class="lxfx" > |
| | | <view class="lxfxbiaoti"><text style="color: #fa3534;">*</text>地址:</view> |
| | | <view class="lxfxnrr"> |
| | | <input placeholder="请输入详细地址" name="address[0]" v-model="business.address[0]" |
| | |
| | | <input type="text" style="display: none;" name="logo" :value="logo_id"> |
| | | <input type="text" style="display: none;" name="logo_height" :value="logo_height"> |
| | | <input type="text" style="display: none;" name="logo_width" :value="logo_width"> |
| | | <input type="text" style="display: none;" name="longitude" :value="business.longitude"> |
| | | <input type="text" style="display: none;" name="latitude" :value="business.latitude"> |
| | | </view> |
| | | <Popup :show="industryShow" :width="screenWidth" type="bottom" :closeable="true" @close="industryClose"> |
| | | <view class="industry-popup"> |
| | |
| | | city_id: 0, // 城市ID |
| | | region_id: 0, // 区域ID |
| | | Introduction: '', // 简介 |
| | | ilk: '' // 名片类型 |
| | | ilk: '' ,// 名片类型 |
| | | latitude:0, |
| | | longitude:0 |
| | | }, |
| | | // 名片类型 |
| | | ilkList: [], // 类型列表 |
| | |
| | | business_card_id: 0, // 名片ID(用于编辑) |
| | | // 图片相关 |
| | | file_id: 0, // 头像文件ID |
| | | file_path: "https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132", // 头像路径 |
| | | file_path: "", // 头像路径 |
| | | logo_id: 0, // Logo文件ID |
| | | logo_path: "http://lblmh.com/image/diy/logo_top.png", // Logo路径 |
| | | logo_path: "", // Logo路径 |
| | | // 布局相关 |
| | | unit: [], // 单位信息数组 |
| | | logo_height: 0, // Logo高度 |
| | |
| | | this.initRegionData(); |
| | | }, |
| | | methods: { |
| | | // 打开地图选择地址 by lyzflash |
| | | chooseLocation(n) { |
| | | let self=this; |
| | | uni.chooseLocation({ |
| | | success: function (res) { |
| | | console.log(res); |
| | | self.business.longitude=res.longitude; |
| | | self.business.latitude=res.latitude; |
| | | self.location_address=res.address; |
| | | self.business.address[0]=res.name; |
| | | // 获取省市区 |
| | | self.setLocationAddress(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 获取掉省市区 by lyzflash |
| | | setLocationAddress() { |
| | | let self = this; |
| | | self._get('user.address/setLocationAddress', { |
| | | address: self.location_address |
| | | }, function(res) { |
| | | /* self.address.location_address = res.data.short_address; */ |
| | | self.business.province_id = res.data.cityCode[0]; |
| | | self.business.city_id = res.data.cityCode[1]; |
| | | self.business.region_id = res.data.cityCode[2]; |
| | | self.selectCity = res.data.region; |
| | | }); |
| | | }, |
| | | templateClose() { |
| | | this.templateShow = !this.templateShow |
| | | }, |
| | |
| | | }) |
| | | this.file_id = res.data.file_id; |
| | | this.logo_id = res.data.logo |
| | | res.data.file_path ? this.file_path = res.data.file_path : ""; |
| | | res.data.logo ? this.logo_path = res.data.logo_image.file_path : ""; |
| | | res.data.file_id ? this.file_path = res.data.file_path : ""; |
| | | res.data.logo ? this.logo_path = res.data.logoImage.file_path : ""; |
| | | res.data.logo_width ? this.logo_width = res.data.logo_width : 0; |
| | | res.data.logo_height ? this.logo_height = res.data.logo_height : 0; |
| | | |
| | |
| | | } |
| | | |
| | | .biaoti { |
| | | color: #37bde6; |
| | | color: #D41003; |
| | | font-size: 40rpx; |
| | | padding: 20rpx 0rpx; |
| | | } |
| | |
| | | |
| | | .tijiao { |
| | | width: 30%; |
| | | background-color: #37bde6; |
| | | background-color: #D41003; |
| | | margin-left: 35%; |
| | | color: #fff; |
| | | } |
| | |
| | | font-size: 36rpx; |
| | | font-weight: bold; |
| | | margin-bottom: 20rpx; |
| | | color: #37bde6; |
| | | color: #D41003; |
| | | } |
| | | |
| | | .industry-item { |
| | |
| | | } |
| | | |
| | | .industry-item.selected { |
| | | color: #37bde6; |
| | | color: #D41003; |
| | | } |
| | | |
| | | .industry-item:active { |
| | |
| | | <!-- 操作按钮区域 --> |
| | | <view class="action-buttons"> |
| | | <view class="action-btn" @click="makePhoneCall(businessInfo.mobile)"> |
| | | <text class="btn-icon">📞</text> |
| | | <image src="@/static/icon/bddh.png" class="btn-icon"></image> |
| | | <text class="btn-text">拨打电话</text> |
| | | </view> |
| | | <view class="action-btn" @click="shareToWechat"> |
| | | <text class="btn-icon">💬</text> |
| | | <image src="@/static/wx.png" class="btn-icon"></image> |
| | | <text class="btn-text">分享微信</text> |
| | | </view> |
| | | <view class="action-btn" @click="openLocation(businessInfo)"> |
| | | <text class="btn-icon">📍</text> |
| | | <image src="@/static/icon/address_icon.png" class="btn-icon"></image> |
| | | <text class="btn-text">导航地址</text> |
| | | </view> |
| | | <button open-type="share" class="action-btn"> |
| | | <text class="btn-icon">➤</text> |
| | | <image src="@/static/icon/fenx.png" class="btn-icon"></image> |
| | | <text class="btn-text">分享名片</text> |
| | | </button> |
| | | </view> |
| | |
| | | // 预览图片 |
| | | uni.previewImage({ |
| | | urls: [_this.businessInfo.mp], |
| | | longPressActions: { |
| | | itemList: ['转发给朋友', '保存图片', '收藏', '翻译图片中的文字', '提取文字'], |
| | | success: function(data) { |
| | | if (data.tapIndex == 1) { |
| | | _this.recordVisit(20) |
| | | } |
| | | console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片'); |
| | | }, |
| | | fail: function(err) { |
| | | console.log(err.errMsg); |
| | | } |
| | | }, |
| | | complete: function(res) { |
| | | console.log(res); |
| | | } |
| | |
| | | }); |
| | | }, |
| | | // 记录访问 |
| | | recordVisit() { |
| | | recordVisit(type=10) { |
| | | let _this = this; |
| | | const params = { |
| | | business_card_id: _this.business_card_id, |
| | | type: 10 |
| | | type: type |
| | | }; |
| | | _this._post('plus.business.saving/add', params, function() { |
| | | // 无需处理返回结果 |
| | |
| | | this.showError('暂无地址信息'); |
| | | return; |
| | | } |
| | | |
| | | // 使用腾讯地图API进行地理编码 |
| | | const apiKey = 'LS7BZ-NHSWK-CWOJQ-AJC7Y-H5HE2-UGBWR'; |
| | | const url = `https://apis.map.qq.com/ws/geocoder/v1/?address=${encodeURIComponent(address)}&key=${apiKey}`; |
| | | |
| | | uni.request({ |
| | | url: url, |
| | | success: (res) => { |
| | | if (res.data.status === 0 && res.data.result) { |
| | | const location = res.data.result.location; |
| | | uni.openLocation({ |
| | | latitude: location.lat, |
| | | longitude: location.lng, |
| | | name: address, |
| | | address: address, |
| | | scale: 18 |
| | | }); |
| | | } else { |
| | | // 地理编码失败,使用默认方式 |
| | | uni.openLocation({ |
| | | latitude: 0, |
| | | longitude: 0, |
| | | name: address, |
| | | address: address, |
| | | scale: 18 |
| | | }); |
| | | } |
| | | }, |
| | | fail: () => { |
| | | // 请求失败,使用默认方式 |
| | | uni.openLocation({ |
| | | latitude: 0, |
| | | longitude: 0, |
| | | name: address, |
| | | address: address, |
| | | scale: 18 |
| | | }); |
| | | console.log( businessInfo.latitude); |
| | | console.log( businessInfo.longitude); |
| | | let latitude=Number(businessInfo.latitude) |
| | | let longitude=Number(businessInfo.longitude) |
| | | uni.openLocation({ |
| | | latitude: latitude, |
| | | longitude: longitude, |
| | | name: businessInfo.address, |
| | | address: address, |
| | | scale: 18, |
| | | complete: function(res) { |
| | | console.log(res); |
| | | } |
| | | |
| | | }); |
| | | |
| | | }, |
| | | // 分享名片 |
| | | shareCard() { |
| | |
| | | |
| | | .btn-icon { |
| | | font-size: 56rpx; |
| | | width: 56rpx; |
| | | height: 56rpx; |
| | | margin-bottom: 12rpx; |
| | | } |
| | | |
| | |
| | | gap: 10rpx; |
| | | |
| | | .create-card-btn { |
| | | background: linear-gradient(90deg, #0078d7, #00b4ff); |
| | | background: linear-gradient(90deg, #ff1529, #ff435f); |
| | | color: #fff; |
| | | font-weight: bold; |
| | | padding: 10rpx 0; |
| | |
| | | |
| | | .confirm-btn { |
| | | color: #fff; |
| | | background-color: #37bde6; |
| | | background-color: #D41003; |
| | | } |
| | | } |
| | | } |
| | |
| | | <text class="close" @click="closePopup">×</text> |
| | | </view> |
| | | <scroll-view scroll-y="true" class="card-scroll"> |
| | | <view class="card-item" v-for="(card, index) in businessList" :key="index" |
| | | @click="selectCard(index)"> |
| | | <view :class="{active: card.is_default==1}" class="card-preview"> |
| | | <image style="width: 650rpx;border-radius: 12rpx;" :src="card.mp" mode="widthFix"></image> |
| | | <image v-show="card.is_default==1" src="@/static/icon/mrmp.png" class="mrmp"> |
| | | </image> |
| | | <uni-swipe-action> |
| | | <view v-for="(card, index) in businessList" :key="index"> |
| | | <uni-swipe-action-item :right-options="rightOptions" @click="handleDel(index, card)"> |
| | | <view @click="selectCard(index)" class="card-item"> |
| | | <view :class="{active: card.is_default==1}" class="card-preview"> |
| | | <image style="width: 650rpx;border-radius: 12rpx;" :src="card.mp" mode="widthFix"></image> |
| | | <image v-show="card.is_default==1" src="@/static/icon/mrmp.png" class="mrmp"></image> |
| | | </view> |
| | | </view> |
| | | </uni-swipe-action-item> |
| | | </view> |
| | | </view> |
| | | </uni-swipe-action> |
| | | <view class="add-card" @click="addNewCard()"> |
| | | <text class="icon iconfont icon-add"></text> |
| | | <text>添加新名片</text> |
| | |
| | | |
| | | <script> |
| | | import Popup from '@/components/uni-popup.vue'; |
| | | import uniSwipeAction from '@/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue'; |
| | | import uniSwipeActionItem from '@/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue'; |
| | | export default { |
| | | components: { |
| | | Popup |
| | | Popup, |
| | | uniSwipeAction, |
| | | uniSwipeActionItem |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | showPayment: false, // 显示支付弹窗 |
| | | paymentMethod: 'balance', // 支付方式 |
| | | topSetting: {}, // 置顶设置 |
| | | userInfo: {} // 用户信息 |
| | | userInfo: {}, // 用户信息 |
| | | rightOptions: [{ |
| | | text: '删除', |
| | | style: { |
| | | backgroundColor: '#FF3B30' |
| | | } |
| | | }] |
| | | }; |
| | | }, |
| | | onLoad() { |
| | |
| | | } else { |
| | | return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); |
| | | } |
| | | }, |
| | | // 删除名片 |
| | | handleDel(index, card) { |
| | | // 防止删除默认名片 |
| | | if (card.is_default === 1) { |
| | | this.showToast('默认名片不能删除'); |
| | | return; |
| | | } |
| | | |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确定要删除这个名片吗?', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | // 调用删除接口 |
| | | this._post('plus.business.business/delete', { |
| | | business_card_id: card.business_card_id |
| | | }, (res) => { |
| | | if (res.code === 1) { |
| | | // 删除成功,更新列表 |
| | | this.businessList.splice(index, 1); |
| | | this.showToast('删除成功'); |
| | | |
| | | // 如果删除的是当前选中的名片,切换到第一个名片 |
| | | if (index === this.current) { |
| | | if (this.businessList.length > 0) { |
| | | this.current = 0; |
| | | this.getStatistics(this.businessList[this.current].business_card_id); |
| | | } |
| | | } else if (index < this.current) { |
| | | // 如果删除的是当前选中名片之前的,current减1 |
| | | this.current--; |
| | | } |
| | | } else { |
| | | this.showToast(res.msg || '删除失败'); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // 显示提示信息 |
| | | showToast(msg) { |
| | | uni.showToast({ |
| | | title: msg, |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | }, |
| | | onShareAppMessage() { |
| | |
| | | |
| | | .icon { |
| | | font-size: 32rpx; |
| | | color: #37bde6; |
| | | color: #D41003; |
| | | margin-right: 16rpx; |
| | | } |
| | | |
| | |
| | | |
| | | .btn { |
| | | flex: 1; |
| | | background: #37bde6; |
| | | background: #D41003; |
| | | color: #fff; |
| | | text-align: center; |
| | | padding: 24rpx 0; |
| | |
| | | |
| | | &.active { |
| | | background: #f5f5f5; |
| | | border: #37bde6 solid 1rpx; |
| | | border: #D41003 solid 1rpx; |
| | | } |
| | | |
| | | .card-company { |
| | |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 30rpx; |
| | | color: #37bde6; |
| | | color: #D41003; |
| | | font-size: 30rpx; |
| | | |
| | | .icon { |
| | |
| | | position: relative; |
| | | |
| | | &.active { |
| | | border-color: #37bde6; |
| | | border-color: #D41003; |
| | | background: #f0f9ff; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .checked { |
| | | color: #37bde6; |
| | | color: #D41003; |
| | | font-size: 36rpx; |
| | | } |
| | | } |
| | |
| | | |
| | | .action-btn { |
| | | padding: 10rpx 32rpx; |
| | | background-color: #37bde6; |
| | | background-color: #D41003; |
| | | color: #fff; |
| | | border-radius: 20rpx; |
| | | font-size: 28rpx; |
| | |
| | | color: #333; |
| | | |
| | | &.active { |
| | | color: #37bde6; |
| | | color: #D41003; |
| | | } |
| | | |
| | | .icon-check { |
| | |
| | | |
| | | .confirm-btn { |
| | | color: #fff; |
| | | background-color: #37bde6; |
| | | background-color: #D41003; |
| | | } |
| | | } |
| | | } |
| | |
| | | message: '保存成功', |
| | | type: 'success' |
| | | }); |
| | | self.$router.push('/plus/business/template/index'); |
| | | }) |
| | | .catch(error => { |
| | | self.loading = false; |
| | |
| | | <div class="user" v-loading="loading"> |
| | | <div class="common-form">名片模板编辑</div> |
| | | <div class="poster-box d-s-s"> |
| | | <div class="left-box"> |
| | | <div class="left-box" style="width: auto;height: auto;"> |
| | | <div v-if="form.backdrop" class="img"><img v-img-url="form.backdrop.src" /></div> |
| | | <div class="userinfo"> |
| | | <!-- 头像 --> |
| | |
| | | message: '保存成功', |
| | | type: 'success' |
| | | }); |
| | | self.$router.push('/plus/business/template/index'); |
| | | }) |
| | | .catch(error => { |
| | | self.loading = false; |