affirm.vue 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318
  1. <template>
  2. <view class="app-content">
  3. <view class="affirm-page">
  4. <view class="affirm-view overscroll">
  5. <form>
  6. <view class="module-com">
  7. <view class="commodity-view">
  8. <view class="commodity-list">
  9. <template v-if="!$util.isEmpty(selectList)">
  10. <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
  11. <!-- #ifdef APP-PLUS -->
  12. <image class="item-icon" :src="item.cover" />
  13. <!-- #endif -->
  14. <!-- #ifdef MP-WEIXIN -->
  15. <image class="item-icon" :src="item.cover" />
  16. <!-- #endif -->
  17. <view class="item-info">
  18. <view class="info-line">
  19. <text class="item-name">
  20. {{ item.name||'' }}
  21. <text v-if="item.variety && item.variety ==1" class="show-color"></text>
  22. </text>
  23. <text class="item-price">
  24. <text class="unit">¥</text>
  25. <text class="price">{{ parseFloat(item.userPrice)||0 }}</text>
  26. </text>
  27. </view>
  28. <view style="text-align:right;position: relative;">
  29. <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-if="item.bigCount > 0">¥{{ parseFloat((Number(item.bigCount)*Number(item.userPrice)).toFixed(2)) }}</text>
  30. <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-else>¥{{ parseFloat((Number(item.smallCount)*Number(item.userPrice)).toFixed(2)) }}</text>
  31. <view class="open-bx" >
  32. <i class="iconfont iconjian" @click="reduceItemFn(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></i>
  33. <text class="num" @click="showAddModelFn(item)">
  34. <text v-if="item.bigCount > 0" style="font-size:24upx;font-weight:bold;color:#3385ff;">{{ item.bigCount }}</text>
  35. <text v-if="item.smallCount > 0" style="font-size:24upx;">{{ item.smallCount }}</text>
  36. </text>
  37. <i class="iconfont iconzeng" @click="addItemFn(item)"></i>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. </view>
  44. <view class="summary-bar">
  45. <view class="operate-view" v-if="isScanEnv" @click="removeFromSave(option.customId)"> <text class="iconfont iconshanchu1"></text>清除花材 </view>
  46. <view class="operate-view" v-else @click="gobackEvent" style="font-size:32upx;font-weight:bold;"><text class="iconfont icongouwuche" style="margin-right:5upx;"></text>返回修改</view>
  47. <view class="describe-view">
  48. <text>合计 ¥{{ allPrice }}</text>
  49. </view>
  50. </view>
  51. <view class="summary-bar">
  52. <view class="operate-view" v-if="isScanEnv"><text class="iconfont iconzeng"></text>手动添加花材</view>
  53. <view class="operate-view" v-if="isScanEnv == false"><text> </text></view>
  54. <view class="describe-view">
  55. <text>{{ selectList.length }}种</text>
  56. <text v-if="Number(allCount.bigLength)>0">,{{allCount.bigLength?parseFloat(allCount.bigLength):0}}扎</text>
  57. <text v-if="Number(allCount.smallLength)>0">,{{allCount.smallLength?parseFloat(allCount.smallLength):0}}支</text>
  58. <text v-if="Number(allCount.weight)>0">,{{allCount.weight?parseFloat(allCount.weight):0}}公斤</text>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.name" color="#333" :size="32" padding="30rpx 30rpx" >
  64. <template slot="customContent">
  65. <view class="select-cmd_bx" v-if="customData">
  66. <view class="kc">
  67. <text class="unit_price">库存 {{ parseFloat(customData.stock) }}</text>
  68. <text class="unit_price" v-if="customData.property==1 || (customData.property==0 && customData.priceType==1)"> ¥{{ parseFloat(customData.price) }}</text>
  69. <text class="unit_price" v-else>--</text>
  70. </view>
  71. <view class="num_bx">
  72. <input style="width: 430upx" v-model="customData.userPrice" @focus="customData.userPrice = null" type="number" placeholder="单价" :disabled="false" />
  73. <text style="font-size:35upx;font-weight:bold;color:#666666;">元</text>
  74. </view>
  75. <view class="num_bx">
  76. <!-- #ifdef APP-PLUS -->
  77. <input style="width: 430upx" v-model="customData.bigCount" v-if="globalUnitType == 0" type="number" />
  78. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">扎</text>
  79. <input style="width: 430upx" v-model="customData.smallCount" v-if="globalUnitType == 1" type="number" />
  80. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">支</text>
  81. <!-- #endif -->
  82. <!-- #ifdef MP-WEIXIN -->
  83. <input style="width: 430upx" v-model="customData.bigCount" v-if="globalUnitType == 0" :focus="isAddInputFocus" type="number" />
  84. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">扎</text>
  85. <input style="width: 430upx" v-model="customData.smallCount" v-if="globalUnitType == 1" :focus="isAddInputFocus" type="number" />
  86. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">支</text>
  87. <!-- #endif -->
  88. <!-- 只有花材 property == 1 才给显示切换功能 -->
  89. <image @click="switchGlobalUnitType" :src="`${constant.imgUrl}/icon/switch/switch128.png`" v-if="customData.property == 1"
  90. style="width:86upx;height:86upx;position:relative;top:-60upx;right:0upx;" mode="widthFix"></image>
  91. </view>
  92. </view>
  93. </template>
  94. </modal-module>
  95. <view class="module-com input-line-wrap">
  96. <view>
  97. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  98. <view class="tui-title">客户</view>
  99. <view class="tui-input">
  100. {{ form.customName||'请选择' }}
  101. </view>
  102. </tui-list-cell>
  103. <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="Number(customInfo.balance)>0">
  104. <view class="tui-title">余额</view>
  105. <view class="tui-input" style="color:#3385FF;font-weight:bold;">
  106. ¥{{ parseFloat(customInfo.balance) }}
  107. </view>
  108. </tui-list-cell>
  109. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  110. <view class="tui-title">收款方式</view>
  111. <button style="margin-right:16upx;height:70upx;line-height:46upx;" @click="form.hasPay = 0" class="admin-button-com mini-btn" :class="form.hasPay == 0 ? 'blue' : 'default'">扫码</button>
  112. <button style="margin-right:16upx;height:70upx;line-height:46upx;" @click="form.hasPay = 4" class="admin-button-com mini-btn" :class="form.hasPay == 4 ? 'blue' : 'default'">余额</button>
  113. <button style="margin-right:16upx;height:70upx;line-height:46upx;" @tap="form.hasPay = 1" class="admin-button-com mini-btn" :class="form.hasPay == 1 ? 'blue' : 'default'">线下</button>
  114. <button style="margin-right:0upx;height:70upx;line-height:46upx;" @click="form.hasPay = 2" class="admin-button-com mini-btn" :class="form.hasPay == 2 ? 'blue' : 'default'">赊账</button>
  115. </tui-list-cell>
  116. <tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.hasPay == 1">
  117. <view class="tui-title">线下渠道</view>
  118. <picker mode="selector" :value="payWayindex" :range="payWayList" range-key="name" @change="payWayChange" class="tui-input">
  119. <view class="uni-input" v-if="form.payWay == 0">线下微信(收款码)</view>
  120. <view class="uni-input" v-else-if="form.payWay == 1">线下支付宝(收款码)</view>
  121. <view class="uni-input" v-else-if="form.payWay == 4">现金</view>
  122. <view class="uni-input" v-else-if="form.payWay == 5">银行卡</view>
  123. <view class="uni-input" v-else style="color:#CCCCCC;">请选择</view>
  124. </picker>
  125. </tui-list-cell>
  126. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  127. <view class="tui-title">配送方式</view>
  128. <button style="margin-right:16upx;height:70upx;line-height:46upx;" @tap="setSendType(1)" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">自取</button>
  129. <button style="margin-right:16upx;height:70upx;line-height:46upx;" @tap="setSendType(0)" class="admin-button-com mini-btn" :class="form.sendType == 0 ? 'blue' : 'default'">配送</button>
  130. <button style="margin-right:16upx;height:70upx;line-height:46upx;" @click="setSendType(2)" class="admin-button-com mini-btn" :class="form.sendType == 2 ? 'blue' : 'default'">跑腿</button>
  131. <button style="margin-right:0upx;height:70upx;line-height:46upx;" @click="setSendType(3)" class="admin-button-com mini-btn" :class="form.sendType == 3 ? 'blue' : 'default'">物流</button>
  132. </tui-list-cell>
  133. <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="form.sendType == 1">
  134. <view class="tui-title">取货状态</view>
  135. <button @tap="form.getGoods = 1" class="admin-button-com middle" style="width:140upx;" :class="form.getGoods == 1? 'blue' : 'default'">已取货</button>
  136. <button @click="form.getGoods = 0" class="admin-button-com middle" style="width:140upx;" :class="form.getGoods == 0 ? 'blue' : 'default'">未取货</button>
  137. </tui-list-cell>
  138. <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="form.sendType == 2">
  139. <view class="tui-title">运费</view>
  140. <input type="digit" placeholder="请填写运费" v-model="form.sendCost" placeholder-class="tui-placeholder"/>
  141. </tui-list-cell>
  142. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  143. <view class="tui-title">打印小票</view>
  144. <button @tap="form.needPrint = 2" class="admin-button-com middle" style="width:140upx;" :class="form.needPrint == 2? 'blue' : 'default'">不打印</button>
  145. <button @click="form.needPrint = 1" class="admin-button-com middle" style="width:140upx;" :class="form.needPrint == 1 ? 'blue' : 'default'">打印</button>
  146. </tui-list-cell>
  147. <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
  148. <view class="tui-title">
  149. <text>合计金额</text>
  150. </view>
  151. <text style="color: #3385FF;width:170upx;">¥{{parseFloat(finalPrice)}}</text>
  152. <button @tap="showDiscount()" class="admin-button-com middle default" style="width:140upx;">打折</button>
  153. <text v-if="discountValue>0 && discountValue<1">{{ Number(discountValue)*10 }}折</text>
  154. </tui-list-cell>
  155. <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
  156. <view v-if="form.hasPay == 2" class="tui-title">应收金额</view>
  157. <view v-else-if="form.hasPay == 3" class="tui-title">余额扣减</view>
  158. <view v-else class="tui-title">{{form.forward==0?'实收':'实付'}}金额</view>
  159. <input style="border:1upx solid #eee;color:#3385FF;width:150upx;height:70upx;" type="digit" @focus="modifyPrice=''" v-model="modifyPrice" placeholder-class="tui-placeholder"/>
  160. <text v-if="modifyPrice > 0 && modifyPrice > finalPrice" style="font-size:25upx;margin-left:20upx;color:red;">人工包装费 ¥{{parseFloat((modifyPrice-finalPrice).toFixed(2))}}</text>
  161. <text v-if="modifyPrice > 0 && modifyPrice < finalPrice" style="font-size:25upx;margin-left:20upx;color:green;">优惠 ¥{{parseFloat((finalPrice-modifyPrice).toFixed(2))}}</text>
  162. </tui-list-cell>
  163. <tui-list-cell class="line-cell" :hover="false" :arrow="true">
  164. <view class="tui-title" v-if="form.sendType == 1">取花日期</view>
  165. <view class="tui-title" v-else>配送日期</view>
  166. <view class="uni-input" v-if="form.reachDate==''" @click="bindReachDateChange">
  167. <view style="width:410upx;font-size:32upx;color:#CCCCCC;">今天</view>
  168. </view>
  169. <view class="uni-input" @click="bindReachDateChange">
  170. <view style="width:410upx;font-size:32upx;">{{form.reachDate}}</view>
  171. </view>
  172. </tui-list-cell>
  173. <tui-list-cell class="line-cell" :hover="false" :arrow="true">
  174. <view class="tui-title" v-if="form.sendType == 1">取花时间</view>
  175. <view class="tui-title" v-else>配送时间</view>
  176. <view class="uni-input" style="width:450upx;font-size:32upx;" @click="openTimePopup">{{form.reachPeriod}}</view>
  177. </tui-list-cell>
  178. <tui-list-cell class="line-cell" :arrow="true">
  179. <div class="tui-title">开单人</div>
  180. <picker mode="selector" :value="form.getStaffId" :range="staffList" range-key="name" @change="kdChange" class="tui-input" >
  181. <input v-model="form.getStaffId" name="getStaffId" type="text" hidden />
  182. <div style="padding:6upx 0 6upx 0;" v-if="form.getStaffName!=''">{{form.getStaffName}}</div>
  183. <div v-else style="padding:6upx 0 6upx 0;color:#CCCCCC;">自己</div>
  184. </picker>
  185. </tui-list-cell>
  186. <tui-list-cell class="line-cell" :hover="false" :arrow="true">
  187. <view class="tui-title">账单日期</view>
  188. <view class="uni-input" v-if="form.historyDate==''" @click="bindHistoryDateChange">
  189. <view style="width:410upx;font-size:32upx;color:#CCCCCC;">今天</view>
  190. </view>
  191. <view class="uni-input" @click="bindHistoryDateChange">
  192. <view style="width:410upx;font-size:32upx;">{{form.historyDate}}</view>
  193. </view>
  194. </tui-list-cell>
  195. <tui-list-cell class="line-cell" :hover="false" :arrow="false">
  196. <view class="tui-title">备注</view>
  197. <textarea style="height:80upx;z-index:0" v-model="form.remark" placeholder-class="remark-class" placeholder="选填" />
  198. </tui-list-cell>
  199. <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="reduceStock == 0">
  200. <view class="tui-title">通知制作</view>
  201. <button @tap="form.needWork = 0;" class="admin-button-com middle" style="width:170upx;" :class="form.needWork == 0? 'blue' : 'default'">不要</button>
  202. <button @click="form.needWork = 1;" class="admin-button-com middle" style="width:170upx;" :class="form.needWork == 1 ? 'blue' : 'default'">需要</button>
  203. </tui-list-cell>
  204. <!-- 如果是扣除库存方式开单,不显示售后付款选项 -->
  205. <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="reduceStock == 0">
  206. <view class="tui-title">订单类型</view>
  207. <button @tap="form.forward = 0;" class="admin-button-com middle" style="width:170upx;" :class="form.forward == 0? 'blue' : 'default'">收入订单</button>
  208. <button @click="form.forward = 1;" class="admin-button-com middle" style="width:170upx;" :class="form.forward == 1 ? 'blue' : 'default'">支出订单</button>
  209. </tui-list-cell>
  210. </view>
  211. </view>
  212. </form>
  213. </view>
  214. <view class="under-bar">
  215. <view class="price-view">
  216. <text class="price-title">
  217. <text></text>
  218. </text>
  219. <text class="price-number"><text class="large">{{form.forward==0?'':'-'}}¥{{ modifyPrice }}</text></text>
  220. </view>
  221. <!-- <text style="font-size:30upx;right:100upx;">当前在<text style="font-weight:bold;color:red;margin-left:5upx;font-size:32upx;">{{currentShop.shopName}}</text></text> -->
  222. <button class="admin-button-com blue big" @click="confirmSubmit">提交</button>
  223. </view>
  224. <view v-if="isScanEnv" @click="changeGet" style="width:125upx;height:125upx;display:flex;justify-content:center;align-items:center;font-size:60upx;
  225. background:#3385ff;color:white;z-index:9999;position:fixed;bottom:230upx;right:40upx;border-radius:60upx;">{{calc=='add'?'+':'-'}}</view>
  226. <uni-popup ref="diffPriceRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
  227. <view style="display:flex;padding:40upx 20upx 20upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
  228. <block v-if="!$util.isEmpty(diffPriceList)">
  229. <view v-for="(item, index) in diffPriceList" :key="index"
  230. style="font-size:32upx;color:red;font-weight:bold;margin-top:10upx;">
  231. <text>{{item.name}}</text>
  232. <text style="margin-left:25upx;">系统售价 ¥{{item.price?parseFloat(item.price):0}}</text>
  233. <text style="margin-left:25upx;">您开价 ¥{{item.kdPrice?parseFloat(item.kdPrice):0}}</text>
  234. </view>
  235. </block>
  236. <view style="margin-top:20upx;font-size:28upx;font-weight:bold;">
  237. <view>以上花材,开单价和系统售价不一样,确认提交吗?</view>
  238. </view>
  239. <view style="text-align:center;margin-top:30upx;width:100%;">
  240. <button class="admin-button-com big default" @click="returnCheck()">返回修改</button>
  241. <button style="margin-left:20upx;" @click="forceCommit()" class="admin-button-com big blue">确认提交</button>
  242. </view>
  243. </view>
  244. </uni-popup>
  245. <!-- 配送时间选择弹框 -->
  246. <uni-popup ref="timePopup" type="bottom" background-color="#fff">
  247. <view class="time-picker-popup">
  248. <view class="popup-header">
  249. <text class="popup-title">选择配送时间</text>
  250. <text class="popup-close" @click="closeTimePopup">×</text>
  251. </view>
  252. <view class="time-sections">
  253. <!-- 小时选择 -->
  254. <view class="time-section">
  255. <view class="section-title">小时</view>
  256. <view class="hours-wrapper">
  257. <scroll-view
  258. scroll-y="true"
  259. class="hours-scroll"
  260. enhanced="true"
  261. show-scrollbar="true"
  262. >
  263. <view class="hours-buttons">
  264. <button
  265. v-for="(hour, index) in timeOptions[0]"
  266. :key="index"
  267. class="time-button"
  268. :class="{ active: selectedHour == hour }"
  269. @click="selectedHour = hour"
  270. >{{ hour }}</button>
  271. </view>
  272. </scroll-view>
  273. </view>
  274. </view>
  275. <!-- 分钟选择 -->
  276. <view class="time-section">
  277. <view class="section-title">分钟</view>
  278. <view class="minutes-wrapper">
  279. <scroll-view
  280. scroll-y="true"
  281. class="minutes-scroll"
  282. enhanced="true"
  283. show-scrollbar="true"
  284. >
  285. <view class="minutes-buttons">
  286. <button
  287. v-for="(minute, index) in timeOptions[1]"
  288. :key="index"
  289. class="time-button"
  290. :class="{ active: selectedMinute == minute }"
  291. @click="selectedMinute = minute"
  292. >{{ minute }}</button>
  293. </view>
  294. </scroll-view>
  295. </view>
  296. </view>
  297. </view>
  298. <!-- 操作按钮 -->
  299. <view class="popup-footer">
  300. <button class="footer-button default" @click="closeTimePopup">取消</button>
  301. <button class="footer-button blue" @click="confirmTime">确认</button>
  302. </view>
  303. </view>
  304. </uni-popup>
  305. <uni-popup ref="discountRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
  306. <view style="display:flex;padding:20upx;min-height:25vh;justify-content: space-between;align-items:center;flex-wrap:wrap;">
  307. <text v-for="(item, index) in discountList" :key="index" @click="setDiscount(item.value)"
  308. style="margin-left:25upx;border:1upx solid #999999;width:100upx;height:100upx;border-radius:20upx;justify-content:center;align-items:center;display:flex;">
  309. {{item.name}}
  310. </text>
  311. </view>
  312. </uni-popup>
  313. <uni-popup ref="remindForwardRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
  314. <view class="forward-popup-content">
  315. <view class="popup-title">
  316. 确认售后付款单
  317. </view>
  318. <view class="option-group">
  319. <view class="option-label">退货方式</view>
  320. <view class="button-group">
  321. <button @click="form.forwardStock = 1" class="admin-button-com big" :class="form.forwardStock == 1 ? 'blue' : 'default'">货不退回</button>
  322. <button @tap="form.forwardStock = 0" class="admin-button-com big" :class="form.forwardStock == 0? 'blue' : 'default'">货退回来</button>
  323. </view>
  324. </view>
  325. <view class="option-group">
  326. <view class="option-label">线下付款方式</view>
  327. <view class="button-group">
  328. <button @tap="forwardPayWay = 0" class="admin-button-com middle" :class="forwardPayWay == 0? 'blue' : 'default'">微信</button>
  329. <button @click="forwardPayWay = 1" class="admin-button-com middle" :class="forwardPayWay == 1 ? 'blue' : 'default'">支付宝</button>
  330. <button @tap="forwardPayWay = 4" class="admin-button-com middle" :class="forwardPayWay == 4? 'blue' : 'default'">现金</button>
  331. <button @click="forwardPayWay = 5" class="admin-button-com middle" :class="forwardPayWay == 5 ? 'blue' : 'default'">银行卡</button>
  332. </view>
  333. <view class="payment-notice">
  334. 请线下转账给客户
  335. </view>
  336. </view>
  337. <view class="popup-footer">
  338. <button class="admin-button-com big default" @click="cancelForward()">取消</button>
  339. <button class="admin-button-com big blue" @click="confirmForward()">确认</button>
  340. </view>
  341. </view>
  342. </uni-popup>
  343. <!-- 账单日期选择器蒙板 -->
  344. <view v-if="showPicker" class="date-picker-mask" @click="showPicker = false"></view>
  345. <mx-date-picker :show="showPicker" format="yyyy-mm-dd" type="date" :value="defaultPickerDate" :show-tips="true" @confirm="confirmPicker" @cancel="showPicker = false" />
  346. <!-- 配送日期选择器蒙板 -->
  347. <view v-if="reachDatePickerShow" class="date-picker-mask" @click="reachDatePickerShow = false"></view>
  348. <mx-date-picker :show="reachDatePickerShow" format="yyyy-mm-dd" type="date" :value="reachDatePickerValue" :show-tips="true" @confirm="confirmReachDatePicker" @cancel="reachDatePickerShow = false" />
  349. </view>
  350. </view>
  351. </template>
  352. <script>
  353. import TuiListCell from "@/components/plugin/list-cell";
  354. import AppAvatarModule from "@/components/module/app-avatar";
  355. import SimpleAddress from "@/components/plugin/simple-address";
  356. import AppAreaSel from "@/components/app-area-sel";
  357. import productMins from "@/mixins/product";
  358. import appFormRadioBtn from "@/components/app-formRadio-btn";
  359. import appAddressGroup from "@/components/app-address-group";
  360. import appSendTime from "@/components/app-send-time";
  361. import appFormSend from "@/components/app-form-send";
  362. const formUtil = require("@/utils/formValidation.js");
  363. import { createOrder } from "@/api/order/index";
  364. import { getAllStaff } from "@/api/shop-admin"
  365. import { mapActions, mapGetters } from "vuex";
  366. import { getCustomInfo} from "@/api/custom"
  367. import ModalModule from "@/components/plugin/modal"
  368. import MxDatePicker from '@/components/mx-datepicker/mx-datepicker.vue';
  369. export default {
  370. name: "affirm",
  371. components: {
  372. TuiListCell,
  373. AppAvatarModule,
  374. SimpleAddress,
  375. AppAreaSel,
  376. appFormRadioBtn,
  377. appAddressGroup,
  378. appSendTime,
  379. appFormSend,
  380. ModalModule,
  381. MxDatePicker
  382. },
  383. mixins: [productMins],
  384. data () {
  385. return {
  386. defaultPickerDate:'',
  387. showPicker: false,
  388. reachDatePickerShow: false,
  389. reachDatePickerValue: '',
  390. discountList:[{name:'1折',value:0.1},{name:'2折',value:0.2},{name:'3折',value:0.3},{name:'4折',value:0.4},{name:'5折',value:0.5},{name:'6折',value:0.6},{name:'7折',value:0.7},{name:'8折',value:0.8},{name:'9折',value:0.9},{name:'不打折',value:1}],
  391. discountValue:0,
  392. autoLoad: false,
  393. staffList:[],
  394. payWayList:[{name:"线下微信",id:0},{name:"线下支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
  395. payWayindex:0,
  396. form: {
  397. shopId: "",
  398. shopName: "",
  399. receiveProvince: "",
  400. receiveCity: "",
  401. receiveFloor: "",
  402. receiveAddress: "",
  403. receiveLong: "",
  404. receiveLat: "",
  405. sendType: 1,
  406. sendSide: "2",
  407. sendDate: "",
  408. reachDate: "",
  409. reachPeriod: "12:00",
  410. historyDate:"",
  411. sendCost: "",
  412. customId: "",
  413. packCost:"",
  414. product: "",
  415. remark:"",
  416. payWay:0,
  417. needPrint:2,
  418. getGoods:1,
  419. hasPay:0,
  420. getStaffName:'',
  421. dealPrice:0,
  422. forward:0,
  423. needWork:0,
  424. forwardStock:1,
  425. fromType:1//门店来的订单
  426. },
  427. showCustomer: false,
  428. customInfo:{discount:1,balance:0},
  429. customData: { bigCount: 0, smallCount: 0, userPrice: 0 },
  430. isAddModel:false,
  431. checkStock:true,
  432. xjData:{},
  433. xjDataInfo:{},
  434. modifyPrice:'',
  435. isScanEnv:false,
  436. calc:'add',
  437. diffPriceList:[],
  438. currentShop:{default:0},
  439. forwardPayWay:0,//不影响原有的form.payWay方式,重新定义一个
  440. reduceStock:0,
  441. timeOptions: [['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],['00', '05', '10','15','20','25','30','35','40','45','50','55']],
  442. selectedHour: '12', // 选中的小时
  443. selectedMinute: '00', // 选中的分钟
  444. };
  445. },
  446. onLoad (option) {
  447. this.kdType = option.kdType
  448. let that = this
  449. this.initMerchantInfo().then((data) => {
  450. uni.setNavigationBarTitle({ title: data.name })
  451. that.currentShop = data.shopInfo
  452. })
  453. if(Number(option.customId) > 0){
  454. this.form.customId = option.customId
  455. let that = this
  456. getCustomInfo({ id: option.customId }).then(res => {
  457. that.form.customName = res.data.custom.name
  458. that.customInfo = res.data.custom
  459. that.$forceUpdate()
  460. })
  461. //用于混入product的已选中花材!!!!!
  462. this.selectJobId = option.customId
  463. this.selectJobType = 'bill'
  464. }
  465. //默认欠款是首选项
  466. this.form.hasPay = 0
  467. // 初始化支付方式索引
  468. this.payWayindex = 0
  469. // #ifdef APP-PLUS
  470. if(this.$util.isScanEnv()){
  471. this.isScanEnv = true
  472. }
  473. //#endif
  474. //如果是扣除库存方式开单,不显示售后付款选项
  475. this.reduceStock = this.option.reduceStock?this.option.reduceStock:0
  476. //如果扣除库存方法,付款方式默认选择赊账,这样方便提交
  477. if(this.reduceStock == 1){
  478. this.form.hasPay = 2
  479. }
  480. },
  481. onShow(){
  482. if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
  483. this.showCustomer = true;
  484. }
  485. //获取所有在职员工
  486. getAllStaff().then(res=>{
  487. if(res.code == 1){
  488. this.staffList = res.data.list
  489. }
  490. })
  491. },
  492. onUnload(){
  493. uni.removeStorageSync('newClient')
  494. uni.$off('listenGetScanCode')
  495. },
  496. computed: {
  497. ...mapGetters(["getMerchantInfo","getMyShopInfo", "getLoginInfo"]),
  498. finalPrice(){
  499. let totalPrice = this.allPrice.toFixed(2)
  500. let finalPrice = Number(totalPrice)
  501. if(this.form.sendType == 2){
  502. finalPrice = Number(finalPrice) + Number(this.form.sendCost)
  503. }
  504. finalPrice = Number(finalPrice).toFixed(2)
  505. let currentPrice = parseFloat(finalPrice)
  506. this.modifyPrice = currentPrice
  507. return currentPrice
  508. },
  509. labourCost(){
  510. let cost = 0
  511. if(Number(this.modifyPrice)>Number(this.finalPrice)){
  512. cost = Number(this.modifyPrice) - Number(this.finalPrice)
  513. cost = Number(cost).toFixed(2)
  514. }
  515. return cost
  516. }
  517. },
  518. methods: {
  519. ...mapActions(["initMerchantInfo"]),
  520. setSendType (type) {
  521. this.form.sendType = type
  522. if (type !== 2) {
  523. this.form.sendCost = ""
  524. }
  525. },
  526. bindHistoryDateChange(){
  527. this.showPicker = true
  528. },
  529. confirmPicker(e) {
  530. this.form.historyDate = e.value
  531. this.showPicker = false
  532. },
  533. bindReachDateChange(){
  534. this.reachDatePickerShow = true
  535. this.reachDatePickerValue = this.form.reachDate
  536. },
  537. confirmReachDatePicker(e) {
  538. this.form.reachDate = e.value
  539. this.reachDatePickerShow = false
  540. },
  541. bindDateChange(e){
  542. let date = e.detail.value
  543. this.form.reachDate = date
  544. },
  545. bindTimeChange(event){
  546. let val = event.detail.value
  547. let before = Number(val[0])
  548. let after = Number(val[1])
  549. let timeOptions = this.timeOptions
  550. this.form.reachPeriod = timeOptions[0][before]+':'+timeOptions[1][after]
  551. },
  552. openTimePopup() {
  553. // 初始化为当前选中的时间
  554. const [hour, minute] = this.form.reachPeriod.split(':')
  555. this.selectedHour = hour
  556. this.selectedMinute = minute
  557. this.$refs.timePopup.open()
  558. },
  559. // 关闭时间选择弹框
  560. closeTimePopup() {
  561. this.$refs.timePopup.close()
  562. },
  563. // 确认时间选择
  564. confirmTime() {
  565. this.form.reachPeriod = `${this.selectedHour}:${this.selectedMinute}`
  566. this.closeTimePopup()
  567. },
  568. showDiscount(){
  569. this.$refs.discountRef.open('center')
  570. },
  571. setDiscount(num){
  572. this.discountValue = Number(num)
  573. let price = Number(this.finalPrice)*Number(num)
  574. price = parseFloat(price.toFixed(2))
  575. this.modifyPrice = price
  576. this.$refs.discountRef.close()
  577. },
  578. beginScan(){
  579. console.log('beginScan')
  580. let that = this
  581. uni.scanCode({
  582. scanType: ['barCode'],
  583. success: function (res) {
  584. that.takeItem(res.result)
  585. }
  586. })
  587. },
  588. changeGet(){
  589. this.calc = this.calc == 'add' ? 'sub' : 'add'
  590. },
  591. reduceItemFn(item) {
  592. if(item && item.variety == 1 && this.selectJobType == 'bill'){
  593. this.$msg('多颜色花材,请返回修改')
  594. return false
  595. }
  596. this.kdType = 'HIT';
  597. this.replaceItemFn(item,0,'sub')
  598. },
  599. addItemFn (item) {
  600. if(item && item.variety == 1 && this.selectJobType == 'bill'){
  601. this.$msg('多颜色花材,请返回修改')
  602. return false
  603. }
  604. this.kdType = 'HIT';
  605. this.replaceItemFn(item,0,'add')
  606. },
  607. init () {
  608. },
  609. kdChange(e){
  610. let index = e.detail.value
  611. if(!this.$util.isEmpty(this.staffList)){
  612. if(this.staffList[index]){
  613. this.form.getStaffName = this.staffList[index].name
  614. this.form.getStaffId = this.staffList[index].id
  615. }
  616. }
  617. },
  618. payWayChange(e){
  619. let index = e.detail.value
  620. this.payWayindex = index
  621. this.form.payWay = this.payWayList[index].id
  622. },
  623. // 根据支付方式ID更新索引
  624. updatePayWayIndex(){
  625. const index = this.payWayList.findIndex(item => item.id === this.form.payWay)
  626. this.payWayindex = index >= 0 ? index : 0
  627. },
  628. setPayWay(payWay){
  629. this.form.payWay = payWay
  630. this.updatePayWayIndex()
  631. },
  632. forceCommit(){
  633. this.form.dealPrice = 1
  634. this.formSubmit()
  635. },
  636. showForward(){
  637. this.$refs.remindForwardRef.open('center')
  638. },
  639. cancelForward(){
  640. this.$refs.remindForwardRef.close()
  641. },
  642. confirmForward(){
  643. //售后付款单,只能走线下模式
  644. this.form.hasPay = 1
  645. this.form.payWay = this.forwardPayWay
  646. this.submitOrder()
  647. },
  648. confirmSubmit(){
  649. if(this.form.forward == 1){
  650. this.showForward()
  651. }else{
  652. if(Number(this.customInfo.balance)>Number(this.modifyPrice) && this.form.hasPay!=4){
  653. //客户余额充值,只能使用余额支付
  654. this.$util.confirmModal({content:'客户余额充足,请使用余额支付'},() => {
  655. this.form.hasPay = 4
  656. this.submitOrder()
  657. })
  658. }else{
  659. this.submitOrder()
  660. }
  661. }
  662. },
  663. submitOrder() {
  664. let self = this;
  665. let name = '确认提交'
  666. if(this.form.hasPay == 0){
  667. name = '确认扫码付?'
  668. }else if(this.form.hasPay == 1){
  669. name = '确认线下付款?'
  670. if(this.form.forward == 1){
  671. name = '确认开售后付款单?'
  672. }
  673. }else if(this.form.hasPay == 2){
  674. name = '确认赊账?'
  675. }else if(this.form.hasPay == 4){
  676. name = '确认余额支付?'
  677. }else{
  678. name = '确认提交'
  679. }
  680. self.$util.confirmModal({content:name},() => {
  681. self.formSubmit()
  682. })
  683. },
  684. async formSubmit () {
  685. let that = this
  686. let formData = this.form;
  687. const product = this.selectList.map((ele) => {
  688. let unitType = Number(ele.bigCount)>0 ? 0 : 1
  689. let num = Number(ele.bigCount)>0 ? Number(ele.bigCount) : Number(ele.smallCount)
  690. let unitPrice = ele.userPrice ? ele.userPrice : 0
  691. return {productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount, classId: ele.classId,
  692. itemId: ele.itemId, unitPrice:unitPrice,remark:ele.remark,property:ele.property,unitType:unitType,num:num}
  693. });
  694. formData.product = JSON.stringify(product);
  695. if (!this.getMerchantInfo) {
  696. await this.initMerchantInfo();
  697. }
  698. formData.shopId = this.getMerchantInfo.id;
  699. if(Number(this.modifyPrice) <= 0){
  700. this.$msg('收款金额必须大于0');
  701. return false
  702. }
  703. let params = {...formData,modifyPrice: this.modifyPrice,labourCost:this.labourCost};
  704. //多颜色
  705. let xj = uni.getStorageSync("xj"+this.option.customId)
  706. //orderType 开单类型,1商品开单 2花材开单
  707. params = {...params,xj:JSON.stringify(xj),orderType:2}
  708. //扣减库存
  709. let orderId = this.option.orderId ? this.option.orderId : 0
  710. let book = this.option.book ? this.option.book : 0
  711. let reduceStock = this.option.reduceStock?this.option.reduceStock:0
  712. params = {...params,orderId:orderId,book:book,reduceStock:reduceStock,version:3}
  713. console.log(params)
  714. uni.showLoading({mask:true})
  715. createOrder(params).then((res) => {
  716. uni.hideLoading()
  717. if(res.code == 1){
  718. if(res.data.respondType && res.data.respondType == 'priceError'){
  719. that.diffPriceList = res.data.diff
  720. that.$refs.diffPriceRef.open('bottom')
  721. return
  722. }
  723. this.removeFromSaveDirect()
  724. if(res.data && res.data.id){
  725. const {data: { id, orderSn,actPrice }} = res;
  726. if(this.form.hasPay == 0){
  727. this.$util.pageTo({ url: '/admin/billing/toPay',type:2,query: {orderId:id,orderSn:orderSn,actPrice:actPrice}})
  728. }else{
  729. if(this.form.forward == 1){
  730. this.$util.pageTo({ url: '/admin/refund/shPayRemind?orderId='+id,type:2})
  731. }else{
  732. this.$util.pageTo({ url: '/admin/billing/result?orderId='+id,type:2})
  733. }
  734. }
  735. }else{
  736. this.$msg('提交失败')
  737. }
  738. }
  739. })
  740. },
  741. returnCheck(){
  742. this.$refs.diffPriceRef.close()
  743. },
  744. gobackEvent () {
  745. let customId = this.option.customId ? this.option.customId : 0
  746. let customName = this.option.customName ? this.option.customName : ''
  747. let reduceStock = this.option.reduceStock?this.option.reduceStock:0
  748. let orderId = this.option.orderId ? this.option.orderId : 0
  749. let book = this.option.book ? this.option.book : 0
  750. let fromType = this.option.fromType ? this.option.fromType : 'item'
  751. if(fromType == 'item'){
  752. this.$util.pageTo({url: '/admin/billing/index2?customId='+customId+'&customName='+customName+'&orderId='+orderId+'&book='+book+'&reduceStock='+reduceStock,type:2})
  753. }else{
  754. this.$util.pageTo({url: '/admin/billing/hs?customId='+customId+'&customName='+customName+'&orderId='+orderId+'&book='+book+'&reduceStock='+reduceStock,type:2})
  755. }
  756. }
  757. }
  758. };
  759. </script>
  760. <style lang="scss" scoped>
  761. .admin-button-com {
  762. margin-right: 30upx;
  763. }
  764. .payment-buttons {
  765. display: flex;
  766. flex-direction: column;
  767. gap: 20upx;
  768. width: 100%;
  769. .button-row {
  770. display: flex;
  771. justify-content: flex-start;
  772. gap: 30upx;
  773. .admin-button-com {
  774. flex: 0 0 180upx;
  775. margin-right: 0;
  776. }
  777. }
  778. }
  779. .affirm-page {
  780. position: relative;
  781. height: 100%;
  782. display: flex;
  783. flex-direction: column;
  784. .affirm-view {
  785. flex: 1;
  786. margin-bottom:90upx;
  787. padding: 20upx;
  788. background-color: #f0f2f6;
  789. .commodity-view {
  790. display: flex;
  791. flex-direction: column;
  792. .commodity-list {
  793. padding: 20upx;
  794. .commodity-item {
  795. display: flex;
  796. margin-bottom: 20upx;
  797. .item-icon {
  798. flex-shrink: 0;
  799. width: 140upx;
  800. height: 140upx;
  801. }
  802. .item-info {
  803. display: flex;
  804. flex-direction: column;
  805. justify-content: center;
  806. flex: 1;
  807. margin-left: 20upx;
  808. .info-line {
  809. margin-bottom: 20upx;
  810. display: flex;
  811. justify-content: space-between;
  812. align-items: flex-end;
  813. .item-name {
  814. color: #333333;
  815. font-size: 28upx;
  816. font-weight:bold;
  817. .show-color{
  818. display:inline-block;
  819. width:25upx;
  820. height:25upx;
  821. background-color:rgb(9, 199, 9);
  822. border-radius:15upx;
  823. border:none;
  824. margin-left:16upx;
  825. }
  826. }
  827. .item-price {
  828. color: #333;
  829. font-size: 22upx;
  830. .price {
  831. font-size: 32upx;
  832. font-weight: bold;
  833. }
  834. }
  835. }
  836. & .open-bx {
  837. align-items: center;
  838. & .iconfont {
  839. color: #3385ff;
  840. font-size: 50upx;
  841. }
  842. & > .num {
  843. display: inline-block;
  844. width: 120upx;
  845. height:45upx;
  846. text-align:center;
  847. margin: 0 8upx;
  848. color: #868686;
  849. border-radius: 22upx;
  850. background-color: #f5f5f5;
  851. padding: 3upx 0;
  852. font-size: 25upx;
  853. }
  854. }
  855. }
  856. }
  857. }
  858. .summary-bar {
  859. padding: 0 20upx;
  860. height: 90upx;
  861. display: flex;
  862. align-items: center;
  863. justify-content: space-between;
  864. border-top: 1upx solid #eeeeee;
  865. .operate-view {
  866. display: flex;
  867. align-items: center;
  868. color: #3385ff;
  869. font-size: 26upx;
  870. .iconfont {
  871. margin-right: 20upx;
  872. font-size: 40upx;
  873. }
  874. }
  875. .describe-view {
  876. display: flex;
  877. align-items: center;
  878. color: #333;
  879. font-size: 28upx;
  880. font-weight:bold;
  881. .price {
  882. margin-left:8upx;
  883. color:red;
  884. }
  885. }
  886. }
  887. }
  888. .module-com {
  889. background-color: #fff;
  890. margin-bottom: 20upx;
  891. border-radius: 10upx;
  892. overflow: hidden;
  893. }
  894. }
  895. .under-bar {
  896. z-index:99999;
  897. display: flex;
  898. justify-content: space-between;
  899. align-items: center;
  900. padding: 0 10upx;
  901. position: fixed;
  902. bottom:0;
  903. @media screen and (max-width: 1100px) {
  904. width: 100%;
  905. }
  906. height: 100upx;
  907. background-color: #fff;
  908. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  909. .price-view {
  910. display: flex;
  911. align-items: center;
  912. font-size: 24upx;
  913. .price-title {
  914. color: #333;
  915. }
  916. .price-number {
  917. margin: 0 8upx;
  918. color: #ff2842;
  919. .large {
  920. font-size:34upx;
  921. font-weight:bold;
  922. }
  923. }
  924. }
  925. .admin-button-com {
  926. width: 200upx;
  927. }
  928. }
  929. .select-cmd_bx {
  930. & .kc {
  931. color: #999999;
  932. font-size: 28upx;
  933. font-weight: 400;
  934. margin-bottom: 40upx;
  935. text-align: center;
  936. margin-top: 30upx;
  937. .unit_price{
  938. padding-right:25upx;
  939. }
  940. }
  941. & .num_bx {
  942. display: flex;
  943. align-items: center;
  944. margin-bottom: 40upx;
  945. & > input {
  946. width: 212upx;
  947. height: 80upx;
  948. border: 1upx solid #dddddd;
  949. border-radius: 4upx;
  950. text-align: center;
  951. margin-right: 24upx;
  952. font-size: 40upx;
  953. }
  954. }
  955. }
  956. }
  957. .class-popup-style{
  958. z-index:99999;
  959. }
  960. .forward-popup-content {
  961. padding: 40upx;
  962. min-width: 700upx;
  963. .popup-title {
  964. font-size: 34upx;
  965. font-weight: bold;
  966. color: #333;
  967. text-align: center;
  968. margin-bottom: 40upx;
  969. line-height: 1.4;
  970. }
  971. .option-group {
  972. margin-bottom: 40upx;
  973. .option-label {
  974. font-size: 28upx;
  975. color: #666;
  976. margin-bottom: 20upx;
  977. font-weight: 500;
  978. }
  979. .button-group {
  980. display: flex;
  981. flex-wrap: wrap;
  982. justify-content: space-between;
  983. gap: 15upx;
  984. .admin-button-com {
  985. margin-right: 0;
  986. flex: 1;
  987. min-width: 140upx;
  988. &:first-child {
  989. margin-left: 0;
  990. }
  991. &:last-child {
  992. margin-right: 0;
  993. }
  994. }
  995. }
  996. .payment-notice {
  997. text-align: center;
  998. font-size: 34upx;
  999. margin-top: 30upx;
  1000. padding: 15upx 20upx;
  1001. background-color: #f5f5f5;
  1002. border-radius: 8upx;
  1003. }
  1004. }
  1005. .popup-footer {
  1006. display: flex;
  1007. justify-content: center;
  1008. gap: 60upx;
  1009. margin-top: 40upx;
  1010. padding-top: 30upx;
  1011. border-top: 1upx solid #eee;
  1012. .admin-button-com {
  1013. margin-right: 0;
  1014. min-width: 160upx;
  1015. }
  1016. }
  1017. }
  1018. .remark-class{
  1019. z-index:0;
  1020. color:#CCCCCC;
  1021. }
  1022. .warning-price{
  1023. color:red;
  1024. }
  1025. /* 日期选择器蒙板 */
  1026. .date-picker-mask {
  1027. position: fixed;
  1028. top: 0;
  1029. left: 0;
  1030. right: 0;
  1031. bottom: 0;
  1032. background-color: rgba(0, 0, 0, 0.5);
  1033. z-index: 99;
  1034. animation: fadeIn 0.3s ease-in-out;
  1035. }
  1036. @keyframes fadeIn {
  1037. from {
  1038. opacity: 0;
  1039. }
  1040. to {
  1041. opacity: 1;
  1042. }
  1043. }
  1044. @keyframes fadeOut {
  1045. from {
  1046. opacity: 1;
  1047. }
  1048. to {
  1049. opacity: 0;
  1050. }
  1051. }
  1052. /* 时间选择弹窗样式 */
  1053. .time-picker-popup {
  1054. width: 100%;
  1055. background: #fff;
  1056. border-radius: 20upx 20upx 0 0;
  1057. display: flex;
  1058. flex-direction: column;
  1059. max-height: 99vh;
  1060. padding:0 0 110upx 0;
  1061. }
  1062. .popup-header {
  1063. display: flex;
  1064. justify-content: space-between;
  1065. align-items: center;
  1066. margin-bottom: 0;
  1067. padding: 30upx 20upx 20upx 20upx;
  1068. border-bottom: 2upx solid #f0f2f6;
  1069. flex-shrink: 0;
  1070. }
  1071. .popup-title {
  1072. font-size: 36upx;
  1073. color: #333;
  1074. font-weight: bold;
  1075. }
  1076. .popup-close {
  1077. font-size: 48upx;
  1078. color: #999;
  1079. line-height: 1;
  1080. cursor: pointer;
  1081. }
  1082. .time-sections {
  1083. display: flex;
  1084. flex-direction: column;
  1085. gap: 20upx;
  1086. margin-bottom: 0;
  1087. flex: 1;
  1088. padding: 20upx 20upx 0 20upx;
  1089. overflow: hidden;
  1090. }
  1091. .time-section {
  1092. flex: 1;
  1093. display: flex;
  1094. flex-direction: column;
  1095. min-height: 200upx;
  1096. .section-title {
  1097. font-size: 28upx;
  1098. color: #333;
  1099. font-weight: 600;
  1100. margin-bottom: 12upx;
  1101. text-align: left;
  1102. }
  1103. }
  1104. .hours-wrapper {
  1105. width: 100%;
  1106. flex: 1;
  1107. background: #f8f9fa;
  1108. border: 2upx solid #e9ecef;
  1109. border-radius: 8upx;
  1110. position: relative;
  1111. overflow: hidden;
  1112. display: flex;
  1113. flex-direction: column;
  1114. min-height: 150upx;
  1115. }
  1116. .minutes-wrapper {
  1117. width: 100%;
  1118. flex: 1;
  1119. background: #f8f9fa;
  1120. border: 2upx solid #e9ecef;
  1121. border-radius: 8upx;
  1122. position: relative;
  1123. overflow: hidden;
  1124. display: flex;
  1125. flex-direction: column;
  1126. min-height: 150upx;
  1127. }
  1128. .hours-scroll,
  1129. .minutes-scroll {
  1130. width: 100%;
  1131. height: 100%;
  1132. padding: 8upx;
  1133. box-sizing: border-box;
  1134. }
  1135. .hours-buttons,
  1136. .minutes-buttons {
  1137. display: flex;
  1138. flex-wrap: wrap;
  1139. gap: 8upx;
  1140. justify-content: flex-start;
  1141. }
  1142. .time-button {
  1143. width: calc(25% - 6upx);
  1144. height: 73upx;
  1145. display: flex;
  1146. align-items: center;
  1147. justify-content: center;
  1148. background: #ffffff;
  1149. border: 2upx solid #e9ecef;
  1150. border-radius: 6upx;
  1151. font-size: 26upx;
  1152. color: #666;
  1153. box-sizing: border-box;
  1154. transition: all 0.2s;
  1155. flex-shrink: 0;
  1156. &.active {
  1157. background: #3385FF;
  1158. border-color: #3385FF;
  1159. color: #fff;
  1160. font-weight: 500;
  1161. }
  1162. &:active {
  1163. background: #e8f5ff;
  1164. }
  1165. }
  1166. .popup-footer {
  1167. display: flex;
  1168. gap: 12upx;
  1169. padding: 15upx 20upx 20upx 20upx;
  1170. border-top: 2upx solid #f0f2f6;
  1171. flex-shrink: 0;
  1172. .footer-button {
  1173. flex: 1;
  1174. height: 93upx;
  1175. display: flex;
  1176. align-items: center;
  1177. justify-content: center;
  1178. border: none;
  1179. border-radius: 8upx;
  1180. font-size: 28upx;
  1181. font-weight: 500;
  1182. transition: all 0.2s;
  1183. &.default {
  1184. background: #f5f5f5;
  1185. color: #666;
  1186. }
  1187. &.blue {
  1188. background: #3385FF;
  1189. color: #fff;
  1190. }
  1191. &:active {
  1192. opacity: 0.8;
  1193. }
  1194. }
  1195. }
  1196. </style>