maintain.vue 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view class="topLeft">
  5. <image :src="maintainCarData.brandLogo" mode="aspectFit" class="brandLogo"></image>
  6. <view class="carName">{{maintainCarData.brand}}-{{maintainCarData.series}}</view>
  7. <image src="../../static/img/icon_edit.png" mode="" class="topEdit" @click="carEdit"></image>
  8. </view>
  9. <view class="topRight">
  10. <input type="number" v-model="maintainCarData.milage" @confirm="upMileage" value="" placeholder="请输入当前里程" class="topInput" placeholder-style="color:#ffffff;"/>
  11. <image src="../../static/img/icon_edit.png" mode="" class="topEdit" @click="milageEdit"></image>
  12. </view>
  13. </view>
  14. <!-- 保养推荐 -->
  15. <view class="maintainrecommend">
  16. <view class="recommendTxt">保养推荐</view>
  17. <view class="manual" @click="handbook()">保养手册</view>
  18. </view>
  19. <!--主体 -->
  20. <view class="main">
  21. <view class="mainLeft">
  22. <scroll-view scroll-y="true" class="mainscrollView">
  23. <view class="mainLeftLine" v-for="(item,index) in mealData" :class="{lineLeftActive:leftIndex==index}"
  24. @click="leftClick(item,index)">
  25. <span>{{item.name}}</span>
  26. <view class="lineNum" v-show="item.num!=0">{{item.num}}</view>
  27. </view>
  28. <view style="height: 100rpx;"></view>
  29. </scroll-view>
  30. </view>
  31. <view class="mainRight">
  32. <scroll-view scroll-y="true" class="mainscrollView">
  33. <view v-show="mealData[leftIndex].listPackage.length==0">
  34. <view class="nodataBox">
  35. <image src="../../static/img/nodata.png" mode="widthFix" class="nodataImg"></image>
  36. <view class="noTxt">暂无数据</view>
  37. </view>
  38. </view>
  39. <view class="mainRightLine" v-for="(item,index) in mealData[leftIndex].listPackage">
  40. <view class="contTop">
  41. <view class="contTopLeft">
  42. <view class="listPackgeName"> {{item.name}} </view>
  43. <view class="listPackgeMs">
  44. <span v-if="item.referenceDosageQty">{{item.referenceDosage}}</span>
  45. </view>
  46. </view>
  47. <view class="contTopRight" @click="listcheck(item,index)">
  48. <image src="../../static/img/login_icon_checked.png" mode="" class="imgPrivacy" v-show="item.planItem"></image>
  49. <image src="../../static/img/login_icon_uncheck.png" mode="" class="imgPrivacy" v-show="!item.planItem"></image>
  50. <!-- <view class="nock" v-show="!item.check"></view> -->
  51. </view>
  52. </view>
  53. <view class="contZk">
  54. <view class="contZkMain" v-show="item.planItem">
  55. <view v-for="(vf,findex) in item.listGoodsAll">
  56. <view class="goodsItemLIne" v-for="(v,i) in vf.goodsList" v-if="i==0" @click="goGoods(v)">
  57. <image :src="v.picUrl" mode="" class="goodsImg" v-if="v.picUrl"></image>
  58. <image src="../../static/img/noimg.png" mode="" class="goodsImg sm" v-else></image>
  59. <view class="goodsCont">
  60. <view class="goodsContTop">
  61. <view class="goodsItemName">{{v.showName}}</view>
  62. <view class="replaceBox" v-if="vf.goodsList.length>1" @click.stop="replace(vf,index,findex,i)">
  63. <!-- <view class="replace" v-if="vf.goodsList.length>1&&!v.gh">更换</view> -->
  64. <view class="replace" >更换</view>
  65. </view>
  66. </view>
  67. <view class="goodsCOntBOttom">
  68. <view class="salePrice">¥{{v.salePrice||v.salePrice==0?v.salePrice:'-'}}</view>
  69. <view class="as">
  70. <view class="asa" @click.stop="reduce(v)">-</view>
  71. <view class="asNum">{{v.qty}}</view>
  72. <view class="asa" @click.stop="plus(v)">+</view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="goodsItemLIne" v-for="(v,i) in item.listItem" >
  79. <image :src="v.picUrl" mode="" class="goodsImg" v-if="v.picUrl"></image>
  80. <image src="../../static/img/icon_xiangmu.png" mode="" class="goodsImg sm" v-else></image>
  81. <view class="goodsCont">
  82. <view class="goodsContTop">
  83. <view class="goodsItemName">{{v.itemName}}</view>
  84. </view>
  85. <view class="goodsCOntBOttom">
  86. <view class="salePrice" >¥{{v.salePrice||v.salePrice==0?v.salePrice:'-'}}</view>
  87. <view class="itemNum">x1</view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <view style="height: 120rpx;"></view>
  95. </scroll-view>
  96. </view>
  97. </view>
  98. <!-- 底部 -->
  99. <view class="bottom">
  100. <view class="bottomLeft">
  101. <view class="caidan" @click="caidanClick">
  102. <image src="../../static/img/caidan.png" mode="" class="caidanImg"></image>
  103. <view class="total" v-show="total>0">{{total}}</view>
  104. </view>
  105. <view>
  106. <view class="heji"> <span class="heji1">合计</span> <span class="hejiNum">¥{{totalhj}}</span> </view>
  107. <view class="hejiMs">商品¥{{goodsTotal}}+工时费¥{{salePriceTotal}}</view>
  108. </view>
  109. </view>
  110. <view class="settlement" @click="settlement">去选店</view>
  111. </view>
  112. <view class="caidanTk" v-show="qingdanShow" @click="qingdanShow=false">
  113. <view class="tkCont">
  114. <view class="caidanTkTop">
  115. <view class="tkTopTitle">清单</view>
  116. <view class="topTopright">
  117. <view class="empty" @click.stop="empty">清空</view>
  118. <view class="close" @click="qingdanShow=false">X</view>
  119. </view>
  120. </view>
  121. <view class="tkMain" @click.stop>
  122. <scroll-view scroll-y="true" class="tkMainSv">
  123. <view class="qingdanLine" v-for="(item,index) in orderData">
  124. <view class="mainTitle">{{item.name}}</view>
  125. <view class="goodsItem" v-for="(v,i) in item.listGoodsAll">
  126. <view >
  127. <image :src="v.picUrl" mode="" class="goodsImg" v-if="v.picUrl"></image>
  128. <image src="../../static/img/noimg.png" mode="" class="goodsImg " v-else></image>
  129. </view>
  130. <view class="goodsItemRight" >
  131. <view class="goodsItemName">{{v.showName}}</view>
  132. <view class="goodsItemBottom">
  133. <view class="goodssalePrice">¥{{v.salePrice||v.salePrice==0?v.salePrice:'-'}}}</view>
  134. <view class="goodsNum">x{{v.qty}}</view>
  135. </view>
  136. </view>
  137. </view>
  138. <view class="goodsItem" v-for="(v,i) in item.listItem">
  139. <view>
  140. <image :src="v.picUrl" mode="" class="goodsImg" v-if="v.picUrl"></image>
  141. <image src="../../static/img/icon_xiangmu.png" mode="" class="goodsImg " v-else></image>
  142. </view>
  143. <view class="goodsItemRight" >
  144. <view class="goodsItemName">{{v.itemName}}</view>
  145. <view class="goodsItemBottom">
  146. <view class="goodssalePrice">¥{{v.salePrice||v.salePrice==0?v.salePrice:'-'}}</view>
  147. <view class="goodsNum">x{{v.qty}}</view>
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. <view class="ckBottom"></view>
  153. </scroll-view>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. </template>
  159. <script>
  160. export default {
  161. data() {
  162. return {
  163. maintainCarData:'',
  164. shopData:'',
  165. mealData:'',
  166. leftIndex:0,
  167. total:0,
  168. qingdanShow:false,
  169. totalhj:0,
  170. goodsTotal:0,
  171. salePriceTotal:0,
  172. orderData:[],
  173. replaceIndex1:'',
  174. replaceIndex2:'',
  175. brand:'',
  176. isNull:true,
  177. csdata:'',
  178. }
  179. },
  180. onLoad(opt) {
  181. this.$common.isUserId()
  182. this.maintainCarData=uni.getStorageSync("maintainCarData");
  183. //console.log(this.maintainCarData)
  184. this.shopData=uni.getStorageSync("shopData");
  185. if(this.maintainCarData.milage==0){
  186. this.maintainCarData.milage='';
  187. }
  188. if (opt.brand) {
  189. this.brand = opt.brand
  190. }
  191. this.getData();
  192. },
  193. onShow() {
  194. var maintainCarData2=uni.getStorageSync("maintainCarData");
  195. if(this.maintainCarData.id!=maintainCarData2.id){
  196. this.maintainCarData=maintainCarData2;
  197. if(this.maintainCarData.milage==0){
  198. this.maintainCarData.milage='';
  199. }
  200. this.getData();
  201. }
  202. var replaceData=uni.getStorageSync("replaceData");
  203. if(replaceData){
  204. //replaceData.qty=1;
  205. console.log(replaceData)
  206. //this.mealData=JSON.parse(JSON.stringify(this.csdata))
  207. //console.log(this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll.goodsList[this.replaceIndex2])
  208. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsList.unshift(replaceData)
  209. //console.log(this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll.goodsList[this.replaceIndex2])
  210. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsList=this.unique(this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsList)
  211. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsList[0].del=false;
  212. //this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2]=replaceData
  213. //this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsName='666'
  214. //console.log(this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2])
  215. this.$forceUpdate()
  216. this.newData()
  217. }
  218. },
  219. methods: {
  220. unique(arr1) {
  221. const res = new Map();
  222. return arr1.filter((a) => !res.has(a.goodsID) && res.set(a.goodsID, 1))
  223. },
  224. upMileage(){
  225. this.getData();
  226. this.$http('worldKeepCar/worldHome/updateTMemberCarByHome', {
  227. id: this.maintainCarData.id,
  228. milage: this.maintainCarData.milage?this.maintainCarData.milage:0,
  229. }, 'POST').then(res => {
  230. uni.hideLoading();
  231. console.log(res);
  232. if (res.code == 0) {
  233. var cardata = uni.getStorageSync("maintainCarData")
  234. if (cardata) {
  235. cardata.milage = this.maintainCarData.milage
  236. uni.setStorage({
  237. key: 'maintainCarData',
  238. data: cardata,
  239. success: function () {
  240. }
  241. });
  242. }
  243. }
  244. })
  245. },
  246. // milageEditconfirm(){
  247. // this.getData();
  248. // var that=this;
  249. // for(let k in this.maintainCarData){this.maintainCarData[k] = this.maintainCarData[k]==null?'':this.maintainCarData[k]}
  250. // this.$http('miniAppMyBMemberCar/updateMemberCar',this.maintainCarData,'POST').then(res => {
  251. // uni.hideLoading();
  252. // uni.setStorage({
  253. // key: 'maintainCarData',
  254. // data: that.maintainCarData,
  255. // success: function () {
  256. // /* uni.navigateBack({
  257. // delta:1
  258. // }) */
  259. // }
  260. // });
  261. // })
  262. // },
  263. leftClick(item,index){
  264. this.leftIndex=index
  265. },
  266. listcheck(item,index){
  267. item.planItem=!item.planItem;
  268. //var
  269. console.log(this.mealData[this.leftIndex].listPackage[index].name)
  270. if(this.mealData[this.leftIndex].listPackage[index].name=='小保养服务'){
  271. this.calculation('大保养服务');
  272. }else if(this.mealData[this.leftIndex].listPackage[index].name=='大保养服务'){
  273. this.calculation('小保养服务');
  274. }else{
  275. this.calculation();
  276. }
  277. /* if(this.mealData[this.leftIndex].name=='小保养'){
  278. this.calculation('大保养');
  279. }else if(this.mealData[this.leftIndex].name=='大保养'){
  280. this.calculation('小保养');
  281. }else{
  282. this.calculation();
  283. } */
  284. if(item.planItem){
  285. /* this.orderData.push(item) */
  286. }
  287. },
  288. goGoods(item){
  289. /* uni.navigateTo({
  290. url:'../module/goodsDetail?goodsId='+item.goodsID+'&type=1'+'&typeIndex=2&maintain=1'
  291. }) */
  292. },
  293. empty(){
  294. var that=this;
  295. uni.showModal({
  296. title: '提示',
  297. content: '确定要清空清单吗',
  298. success: function (res) {
  299. if (res.confirm) {
  300. that.orderData=[];
  301. that.mealData.forEach(item=>{
  302. item.num=0;
  303. if(item.listPackage){
  304. item.listPackage.forEach(v=>{
  305. v.planItem=false
  306. })
  307. }
  308. })
  309. console.log(that.mealData)
  310. that.calculation();
  311. that.qingdanShow=false;
  312. }
  313. }
  314. });
  315. },
  316. calculation(txt){
  317. this.isNull=true
  318. this.total=0;
  319. this.totalhj=0;
  320. this.goodsTotal=0;
  321. this.salePriceTotal=0;
  322. this.orderData=[]
  323. this.mealData.forEach(v=>{
  324. v.num=0;
  325. v.listPackage.forEach(i=>{
  326. if(txt == i.name){
  327. i.planItem=false
  328. }
  329. })
  330. if(txt == v.name){
  331. console.log(v.name)
  332. /* if(v.listPackage){
  333. v.listPackage.forEach(i=>{
  334. i.planItem=false
  335. })
  336. } */
  337. }else{
  338. if(v.listPackage){
  339. v.listPackage.forEach(i=>{
  340. if(i.planItem){
  341. var obj={
  342. listGoodsAll:[],
  343. listItem:'',
  344. id:i.id,
  345. name:i.name
  346. }
  347. if(i.listGoodsAll.length>0){
  348. i.listGoodsAll.forEach((goods,goodsIndex)=>{
  349. console.log(goods.goodsGroupDetail)
  350. /* goods.forEach(sp=>{
  351. this.goodsTotal=Number(this.goodsTotal)
  352. this.goodsTotal+=sp.salePrice*sp.qty
  353. this.goodsTotal=this.goodsTotal.toFixed(2)
  354. })
  355. //goods[0].salePrice=1;*/
  356. this.goodsTotal=Number(this.goodsTotal)
  357. if(!isNaN(goods.goodsList[0].salePrice)){
  358. this.goodsTotal+=goods.goodsList[0].salePrice*goods.goodsList[0].qty
  359. this.goodsTotal=this.goodsTotal.toFixed(2)
  360. }else{
  361. this.isNull=false
  362. }
  363. if(goods.goodsList[0].salePrice==null){
  364. this.isNull=false
  365. }
  366. obj.listGoodsAll.push(goods.goodsList[0])
  367. })
  368. }
  369. if(i.listItem.length>0){
  370. obj.listItem=i.listItem
  371. }
  372. this.orderData.push(obj)
  373. v.num++;
  374. this.total++;
  375. i.listItem.forEach(xm=>{
  376. xm.qty=1;
  377. if(!isNaN(xm.salePrice)){
  378. this.salePriceTotal=Number(this.salePriceTotal)
  379. this.salePriceTotal+=xm.salePrice
  380. this.salePriceTotal=this.salePriceTotal.toFixed(2)
  381. }else{
  382. this.isNull=false
  383. }
  384. if(xm.salePrice==null){
  385. this.isNull=false
  386. }
  387. //xm.salePrice=1;
  388. })
  389. //this.totalhj
  390. }
  391. })
  392. }
  393. }
  394. //if(v.listPackage)
  395. })
  396. this.totalhj=Number(this.goodsTotal)+Number(this.salePriceTotal)
  397. this.totalhj=this.totalhj.toFixed(2)
  398. console.log(this.orderData)
  399. },
  400. reduce(v){
  401. console.log(v)
  402. if(v.qty>1){
  403. v.qty--;
  404. this.calculation()
  405. }else if(v.del){
  406. if(v.qty>0){
  407. v.qty--;
  408. this.calculation()
  409. }
  410. }
  411. },
  412. plus(v){
  413. v.qty++;
  414. this.calculation()
  415. },
  416. getData(){
  417. uni.showLoading({
  418. title: '加载中'
  419. })
  420. var location = uni.getStorageSync("locationCity");
  421. var selectCity = uni.getStorageSync("selectCity");
  422. var cityCode=''
  423. if(selectCity){
  424. cityCode=selectCity.code
  425. }else{
  426. cityCode=location.cityCode
  427. }
  428. this.$http('miniApp/tPackageMiniAppController/queryPackageList', {
  429. mileage:this.maintainCarData.milage,
  430. liyangId:this.maintainCarData.nLevelID,
  431. cityCode:cityCode,
  432. guidePrice:this.maintainCarData.guidePrice?this.maintainCarData.guidePrice:0,
  433. },'GET').then(res => {
  434. console.log(res)
  435. // this.csdata=JSON.parse(JSON.stringify(res.data))
  436. uni.hideLoading();
  437. if(res.code==1){
  438. uni.showModal({
  439. title: '提示',
  440. content: res.msg,
  441. showCancel:false,
  442. success: function (res) {
  443. }
  444. });
  445. }
  446. res.data.forEach(item=>{
  447. //console.log(item)
  448. item.listPackage.forEach((list,i)=>{
  449. if(list.listGoodsAll.length>0){
  450. list.listGoodsAll.forEach((goods,index)=>{
  451. var brandName=goods.goodsList[0].brandName
  452. var newtp=[];
  453. goods.goodsGroupDetail.forEach(tgoods=>{
  454. if(brandName==tgoods.brandName){
  455. newtp.push(tgoods)
  456. }
  457. })
  458. goods.goodsGroupDetail=newtp
  459. /* console.log("同品组")
  460. console.log(goods.goodsGroupDetail) */
  461. if(goods.goodsGroupDetail.length==0){
  462. if(!list.referenceDosageQty){
  463. goods.goodsList[0].qty=1;
  464. return false;
  465. }
  466. //同组品为空的情况
  467. var referenceDosageQty=Number(list.referenceDosageQty)
  468. referenceDosageQty=Math.ceil(referenceDosageQty)
  469. if(Number.isInteger(referenceDosageQty/goods.goodsList[0].capacity)){
  470. goods.goodsList[0].qty=referenceDosageQty/goods.goodsList[0].capacity
  471. }else
  472. if(goods.goodsList[0].capacity&&!goods.goodsList[0].del){
  473. console.log(list.name+"??==="+referenceDosageQty/goods.goodsList[0].capacity)
  474. if(referenceDosageQty/goods.goodsList[0].capacity>1){
  475. var qtynum1=referenceDosageQty-goods.goodsList[0].capacity
  476. var qtynum2=Math.ceil(qtynum1/goods.goodsList[0].capacity)
  477. goods.goodsList.splice(300);
  478. var addArrnt=JSON.parse(JSON.stringify(goods.goodsList))
  479. //console.log(addArrnt[0])
  480. addArrnt[0].qty=qtynum2;
  481. addArrnt[0].gh=true
  482. var addDta={
  483. goodsGroupDetail:[],
  484. goodsList:addArrnt
  485. }
  486. addDta.goodsList.forEach(add=>{
  487. add.del=true;
  488. })
  489. //addDta.splice(1,0)
  490. console.log(addDta)
  491. if(addDta.goodsList[0].capacity==goods.goodsList[0].capacity){
  492. goods.goodsList[0].qty=1
  493. goods.goodsList[0].qty++
  494. }else{
  495. var add=JSON.parse(JSON.stringify(addDta))
  496. list.listGoodsAll.splice(index+1, 0,add)
  497. }
  498. //var add=JSON.parse(JSON.stringify(addDta))
  499. //list.listGoodsAll.splice(index+1, 0,add)
  500. }
  501. }
  502. }else{
  503. //同组品不为空的情况
  504. //console.log("同组品不为空的情况 ")
  505. //debugger;
  506. var remainder=0;
  507. var addNum=index
  508. console.log("list.referenceDosageQty - "+list.referenceDosageQty+list.name)
  509. var referenceDosageQty=Number(list.referenceDosageQty)
  510. //var addArr= goods.goodsList
  511. referenceDosageQty=Math.ceil(referenceDosageQty)
  512. goods.goodsList.splice(300);
  513. if(list.referenceDosageQty&&!goods.goodsList[0].del){
  514. goods.goodsGroupDetail.forEach((tgoods,tindex)=>{
  515. var addArr=JSON.parse(JSON.stringify(goods.goodsList))
  516. if(tindex==0){
  517. console.log(tgoods.brandName)
  518. if(tgoods.capacity){
  519. if(referenceDosageQty>tgoods.capacity||referenceDosageQty==tgoods.capacity){
  520. if(goods.goodsGroupDetail.length==1){
  521. //console.log("referenceDosageQty>tgoods.capacity")
  522. var parseIntNum=parseInt(referenceDosageQty/tgoods.capacity)
  523. //console.log("parseIntNum--"+parseIntNum)
  524. tgoods.qty=parseIntNum+1
  525. addArr.unshift(tgoods)
  526. var reduce= tgoods.capacity*parseIntNum
  527. referenceDosageQty=referenceDosageQty - reduce
  528. var addDta={
  529. //goodsGroupDetail:[],
  530. goodsGroupDetail:goods.goodsGroupDetail,
  531. goodsList:addArr,
  532. del:true,
  533. }
  534. addDta.goodsList.forEach(add=>{
  535. add.del=true;
  536. })
  537. list.listGoodsAll.splice(index, 1,addDta)
  538. }else{
  539. //console.log("referenceDosageQty>tgoods.capacity")
  540. var parseIntNum=parseInt(referenceDosageQty/tgoods.capacity)
  541. //console.log("parseIntNum--"+parseIntNum)
  542. tgoods.qty=parseIntNum
  543. addArr.unshift(tgoods)
  544. var reduce= tgoods.capacity*parseIntNum
  545. referenceDosageQty=referenceDosageQty - reduce
  546. var addDta={
  547. //goodsGroupDetail:[],
  548. goodsGroupDetail:goods.goodsGroupDetail,
  549. goodsList:addArr,
  550. del:true,
  551. }
  552. addDta.goodsList.forEach(add=>{
  553. add.del=true;
  554. })
  555. list.listGoodsAll.splice(index, 1,addDta)
  556. }
  557. }else{
  558. console.log("推荐大于容量")
  559. if(goods.goodsGroupDetail.length==1){
  560. console.log("同组品 一个")
  561. addArr.unshift(tgoods)
  562. referenceDosageQty=referenceDosageQty-tgoods.capacity
  563. var addDta={
  564. //goodsGroupDetail:[],
  565. goodsGroupDetail:goods.goodsGroupDetail,
  566. goodsList:addArr,
  567. del:true,
  568. }
  569. addDta.goodsList.forEach(add=>{
  570. add.del=true;
  571. })
  572. list.listGoodsAll.splice(index, 1,addDta)
  573. }else{
  574. list.listGoodsAll.splice(index, 1)
  575. }
  576. }
  577. }else{
  578. addArr.unshift(tgoods)
  579. var addDta={
  580. //goodsGroupDetail:[],
  581. goodsGroupDetail:goods.goodsGroupDetail,
  582. goodsList:addArr,
  583. del:true,
  584. }
  585. addDta.goodsList.forEach(add=>{
  586. add.del=true;
  587. })
  588. list.listGoodsAll.splice(index, 1,addDta)
  589. }
  590. }else{
  591. if(goods.goodsGroupDetail[0].capacity){
  592. if(referenceDosageQty>0){
  593. console.log('referenceDosageQty'+referenceDosageQty)
  594. console.log(tgoods)
  595. /* remainder=Number(referenceDosageQty)%tgoods.capacity
  596. if(remainder>1){
  597. addArr.unshift(tgoods)
  598. }
  599. referenceDosageQty=referenceDosageQty-tgoods.capacity */
  600. if(referenceDosageQty>tgoods.capacity){
  601. var parseIntNum=parseInt(referenceDosageQty/tgoods.capacity)
  602. var reduce= tgoods.capacity*parseIntNum
  603. if(goods.goodsGroupDetail.length==tindex+1){
  604. var a=referenceDosageQty - reduce
  605. if(a>0){
  606. parseIntNum++
  607. }
  608. }
  609. tgoods.qty=parseIntNum
  610. addArr.unshift(tgoods)
  611. //addArr[0].gh=true
  612. referenceDosageQty=referenceDosageQty - reduce
  613. var addDta={
  614. //goodsGroupDetail:[],
  615. goodsGroupDetail:goods.goodsGroupDetail,
  616. goodsList:addArr,
  617. del:true,
  618. tpn:true,
  619. }
  620. addDta.goodsList.forEach(add=>{
  621. add.del=true;
  622. })
  623. //console.log(addArr)
  624. if(tindex==0){
  625. // console.log(addDta.goodsList[0])
  626. //list.listGoodsAll.splice(index, 1,addDta)
  627. //console.log(list.listGoodsAll[index])
  628. }else{
  629. addNum++
  630. console.log('addNum=='+addNum)
  631. //console.log(addDta.goodsList[0])
  632. list.listGoodsAll.splice(addNum, 0,addDta)
  633. }
  634. }else{
  635. if(goods.goodsGroupDetail.length==tindex+1){
  636. addArr.unshift(tgoods)
  637. //addArr[0].gh=true
  638. referenceDosageQty=referenceDosageQty-tgoods.capacity
  639. var addDta={
  640. //goodsGroupDetail:[],
  641. goodsGroupDetail:goods.goodsGroupDetail,
  642. goodsList:addArr,
  643. del:true,
  644. tpn:true,
  645. //gh:true,
  646. }
  647. addDta.goodsList.forEach(add=>{
  648. add.del=true;
  649. })
  650. //console.log(addArr)
  651. if(tindex==0){
  652. // console.log(addDta.goodsList[0])
  653. //list.listGoodsAll.splice(index, 1,addDta)
  654. //console.log(list.listGoodsAll[index])
  655. }else{
  656. addNum++
  657. console.log('addNum=='+addNum)
  658. //console.log(addDta.goodsList[0])
  659. list.listGoodsAll.splice(addNum, 0,addDta)
  660. }
  661. }
  662. }
  663. }
  664. }
  665. }
  666. } )
  667. }
  668. }
  669. })
  670. }
  671. })
  672. })
  673. this.mealData=res.data;
  674. this.mealData.splice(1,0)
  675. //debugger;
  676. console.log("第一次的数据")
  677. console.log(this.mealData)
  678. this.calculation();
  679. })
  680. },
  681. newData(){
  682. var replaceData=uni.getStorageSync("replaceData");
  683. var location = uni.getStorageSync("locationCity");
  684. var selectCity = uni.getStorageSync("selectCity");
  685. var cityCode=''
  686. if(selectCity){
  687. cityCode=selectCity.code
  688. }else{
  689. cityCode=location.cityCode
  690. }
  691. var params={
  692. mileage:this.maintainCarData.milage,
  693. liyangId:this.maintainCarData.nLevelID,
  694. cityCode:cityCode,
  695. guidePrice:this.maintainCarData.guidePrice?this.maintainCarData.guidePrice:0,
  696. goodsID:replaceData.mGoodsID,
  697. itemID:replaceData.itemID,
  698. packageID:replaceData.packageID,
  699. packageGoodsGroupID:replaceData.packageGoodsGroupID,
  700. }
  701. uni.showLoading({ });
  702. var arr=[]
  703. this.$http('miniApp/tPackageMiniAppController/queryTGoodsGroupDetailForApp', params,'GET').then(res => {
  704. uni.hideLoading();
  705. if(res.data.length>0){
  706. res.data.forEach(item=>{
  707. if(item.brandName==replaceData.brandName){
  708. arr.push(item)
  709. }
  710. })
  711. arr.forEach((item,index)=>{
  712. if(item.goodsID==replaceData.goodsID){
  713. arr.splice(index, 1)
  714. }
  715. })
  716. arr.unshift(replaceData)
  717. }
  718. console.log("处理的同品组")
  719. console.log(arr)
  720. // debugger;
  721. var packageGoodsGroupID=this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsList[0].packageGoodsGroupID
  722. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll.forEach(item=>{
  723. if(packageGoodsGroupID==item.goodsList[0].packageGoodsGroupID){
  724. item.tpn=true
  725. }
  726. })
  727. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].tpn=false;
  728. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsGroupDetail=arr
  729. this.mealData.splice(1,0)
  730. console.log("this.leftIndex"+this.leftIndex+'--'+this.replaceIndex1+'--'+this.replaceIndex2)
  731. console.log(this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2])
  732. console.log(this.mealData)
  733. this.chulidata()
  734. })
  735. },
  736. chulidata(){
  737. //debugger;
  738. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsList.forEach((item,index)=>{
  739. if(item.gh){
  740. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll[this.replaceIndex2].goodsList.splice(index, 1)
  741. }
  742. })
  743. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll.forEach((item,index)=>{
  744. if(item.tpn){
  745. this.mealData[this.leftIndex].listPackage[this.replaceIndex1].listGoodsAll.splice(index, 1)
  746. }
  747. })
  748. this.mealData.forEach((item,index1)=>{
  749. item.listPackage.forEach((list,i)=>{
  750. list.listGoodsAll.forEach((goods,index)=>{
  751. goods.goodsGroupDetail.forEach(tgoods=>{
  752. tgoods.del=false;
  753. })
  754. goods.goodsList.forEach(tgoods=>{
  755. tgoods.del=false;
  756. })
  757. goods.goodsList[0].del=false;
  758. if(goods.tpn){
  759. list.listGoodsAll.splice(index, 1)
  760. }
  761. })
  762. })
  763. })
  764. console.log("重新初始化数据")
  765. console.log(this.mealData)
  766. this.mealData.forEach(item=>{
  767. //console.log(item)
  768. item.listPackage.forEach((list,i)=>{
  769. if(list.listGoodsAll.length>0){
  770. console.log(list.name)
  771. list.listGoodsAll.forEach((goods,index)=>{
  772. var brandName=goods.goodsList[0].brandName
  773. var newtp=[];
  774. goods.goodsGroupDetail.forEach(tgoods=>{
  775. //tgoods.del=false;
  776. if(brandName==tgoods.brandName){
  777. newtp.push(tgoods)
  778. }
  779. })
  780. goods.goodsGroupDetail=newtp
  781. /* console.log("同品组")
  782. console.log(goods.goodsGroupDetail) */
  783. if(goods.goodsGroupDetail.length==0){
  784. //同组品为空的情况
  785. if(!list.referenceDosageQty){
  786. goods.goodsList[0].qty=1;
  787. return false;
  788. }
  789. console.log("同组品为空的情况")
  790. var referenceDosageQty=Number(list.referenceDosageQty)
  791. referenceDosageQty=Math.ceil(referenceDosageQty)
  792. if(Number.isInteger(referenceDosageQty/goods.goodsList[0].capacity)){
  793. goods.goodsList[0].qty=referenceDosageQty/goods.goodsList[0].capacity
  794. }else
  795. if(goods.goodsList[0].capacity>0&&!goods.goodsList[0].del){
  796. goods.goodsList.forEach((newGoods,newindex)=>{
  797. if(newindex==0&&!goods.goodsList[0].del){
  798. var qtynum1=referenceDosageQty-newGoods.capacity
  799. var qtynum2=Math.ceil(qtynum1/newGoods.capacity)
  800. console.log("qtynum2=="+qtynum2)
  801. goods.goodsList[0].qty=qtynum2;
  802. goods.goodsList[0].del=true;
  803. referenceDosageQty=referenceDosageQty-(qtynum2*newGoods.capacity)
  804. }else if(newindex!=0&&!newGoods.del){
  805. console.log("referenceDosageQty---"+referenceDosageQty)
  806. if(referenceDosageQty>0){
  807. //var qtynum4=referenceDosageQty-newGoods.capacity
  808. var qtynum3=Math.ceil(referenceDosageQty/newGoods.capacity)
  809. referenceDosageQty=referenceDosageQty-(qtynum3*newGoods.capacity)
  810. var addArrnt=JSON.parse(JSON.stringify(goods.goodsList))
  811. addArrnt[0].qty=qtynum3;
  812. var addDta={
  813. goodsGroupDetail:[],
  814. goodsList:addArrnt
  815. }
  816. addDta.goodsList.forEach(add=>{
  817. add.del=true;
  818. })
  819. //console.log(addDta)
  820. //console.log("第一个容量"+goods.goodsList[0].capacity)
  821. if(addDta.goodsList[0].capacity==goods.goodsList[0].capacity){
  822. goods.goodsList[0].qty=1
  823. goods.goodsList[0].qty++
  824. }else{
  825. var add=JSON.parse(JSON.stringify(addDta))
  826. list.listGoodsAll.splice(index+1, 0,add)
  827. }
  828. //if(addArrnt[0].)
  829. }
  830. }
  831. })
  832. /* if(referenceDosageQty/goods.goodsList[0].capacity>1){
  833. var qtynum1=referenceDosageQty-goods.goodsList[0].capacity
  834. var qtynum2=Math.ceil(qtynum1/goods.goodsList[0].capacity)
  835. console.log("qtynum2=="+qtynum2)
  836. goods.goodsList.splice(300);
  837. var addArrnt=JSON.parse(JSON.stringify(goods.goodsList))
  838. addArrnt[0].qty=qtynum2;
  839. var addDta={
  840. goodsGroupDetail:[],
  841. goodsList:addArrnt
  842. }
  843. addDta.goodsList.forEach(add=>{
  844. add.del=true;
  845. })
  846. console.log(addDta)
  847. var add=JSON.parse(JSON.stringify(addDta))
  848. list.listGoodsAll.splice(index+1, 0,add)
  849. } */
  850. }
  851. }else{
  852. //同组品不为空的情况
  853. //console.log("同组品不为空的情况 ")
  854. if(!list.referenceDosageQty){
  855. goods.goodsList[0].qty=1;
  856. return false;
  857. }
  858. var remainder=0;
  859. var addNum=index
  860. console.log("list.referenceDosageQty - "+list.referenceDosageQty+list.name)
  861. var referenceDosageQty=Number(list.referenceDosageQty)
  862. //var addArr= goods.goodsList
  863. referenceDosageQty=Math.ceil(referenceDosageQty)
  864. goods.goodsList.splice(300);
  865. console.log("referenceDosageQty---"+referenceDosageQty + "goods.goodsList[0].del---" +goods.goodsList[0].del)
  866. if(list.referenceDosageQty&&!goods.goodsList[0].del){
  867. goods.goodsGroupDetail.forEach((tgoods,tindex)=>{
  868. var addArr=JSON.parse(JSON.stringify(goods.goodsList))
  869. //debugger;
  870. if(tindex==0){
  871. console.log(tgoods.brandName)
  872. if(tgoods.capacity){
  873. if(referenceDosageQty>tgoods.capacity||referenceDosageQty==tgoods.capacity){
  874. if(goods.goodsGroupDetail.length==1){
  875. //console.log("referenceDosageQty>tgoods.capacity")
  876. var parseIntNum=parseInt(referenceDosageQty/tgoods.capacity)
  877. //console.log("parseIntNum--"+parseIntNum)
  878. tgoods.qty=parseIntNum+1
  879. addArr.unshift(tgoods)
  880. var reduce= tgoods.capacity*parseIntNum
  881. referenceDosageQty=referenceDosageQty - reduce
  882. var addDta={
  883. //goodsGroupDetail:[],
  884. goodsGroupDetail:goods.goodsGroupDetail,
  885. goodsList:addArr,
  886. del:true,
  887. }
  888. addDta.goodsList.forEach(add=>{
  889. add.del=true;
  890. })
  891. list.listGoodsAll.splice(index, 1,addDta)
  892. }else{
  893. //console.log("referenceDosageQty>tgoods.capacity")
  894. var parseIntNum=parseInt(referenceDosageQty/tgoods.capacity)
  895. //console.log("parseIntNum--"+parseIntNum)
  896. tgoods.qty=parseIntNum
  897. /* if(tgoods.capacity==1){
  898. tgoods.qty=tgoods.qty+1
  899. } */
  900. addArr.unshift(tgoods)
  901. var reduce= tgoods.capacity*parseIntNum
  902. referenceDosageQty=referenceDosageQty - reduce
  903. var addDta={
  904. //goodsGroupDetail:[],
  905. goodsGroupDetail:goods.goodsGroupDetail,
  906. goodsList:addArr,
  907. del:true,
  908. }
  909. addDta.goodsList.forEach(add=>{
  910. add.del=true;
  911. })
  912. list.listGoodsAll.splice(index, 1,addDta)
  913. }
  914. }else{
  915. console.log("推荐大于容量")
  916. if(goods.goodsGroupDetail.length==1){
  917. console.log("同组品 一个")
  918. addArr.unshift(tgoods)
  919. referenceDosageQty=referenceDosageQty-tgoods.capacity
  920. var addDta={
  921. //goodsGroupDetail:[],
  922. goodsGroupDetail:goods.goodsGroupDetail,
  923. goodsList:addArr,
  924. del:true,
  925. }
  926. addDta.goodsList.forEach(add=>{
  927. add.del=true;
  928. })
  929. list.listGoodsAll.splice(index, 1,addDta)
  930. }else{
  931. list.listGoodsAll.splice(index, 1)
  932. }
  933. }
  934. }else{
  935. addArr.unshift(tgoods)
  936. var addDta={
  937. //goodsGroupDetail:[],
  938. goodsGroupDetail:goods.goodsGroupDetail,
  939. goodsList:addArr,
  940. del:true,
  941. }
  942. addDta.goodsList.forEach(add=>{
  943. add.del=true;
  944. })
  945. list.listGoodsAll.splice(index, 1,addDta)
  946. }
  947. }else{
  948. if(goods.goodsGroupDetail[0].capacity){
  949. if(referenceDosageQty>0||referenceDosageQty==1){
  950. console.log('referenceDosageQty'+referenceDosageQty)
  951. console.log(tgoods)
  952. /* remainder=Number(referenceDosageQty)%tgoods.capacity
  953. if(remainder>1){
  954. addArr.unshift(tgoods)
  955. }
  956. referenceDosageQty=referenceDosageQty-tgoods.capacity */
  957. if(referenceDosageQty>tgoods.capacity){
  958. var parseIntNum=parseInt(referenceDosageQty/tgoods.capacity)
  959. var reduce= tgoods.capacity*parseIntNum
  960. if(goods.goodsGroupDetail.length==tindex+1){
  961. var a=referenceDosageQty - reduce
  962. if(a>0){
  963. parseIntNum++
  964. }
  965. }
  966. tgoods.qty=parseIntNum
  967. addArr.unshift(tgoods)
  968. referenceDosageQty=referenceDosageQty - reduce
  969. var addDta={
  970. //goodsGroupDetail:[],
  971. goodsGroupDetail:goods.goodsGroupDetail,
  972. goodsList:addArr,
  973. del:true,
  974. tpn:true,
  975. }
  976. addDta.goodsList.forEach(add=>{
  977. add.del=true;
  978. })
  979. //console.log(addArr)
  980. if(tindex==0){
  981. // console.log(addDta.goodsList[0])
  982. //list.listGoodsAll.splice(index, 1,addDta)
  983. //console.log(list.listGoodsAll[index])
  984. }else{
  985. addNum++
  986. console.log('addNum=='+addNum)
  987. //console.log(addDta.goodsList[0])
  988. list.listGoodsAll.splice(addNum, 0,addDta)
  989. }
  990. }else{
  991. if(goods.goodsGroupDetail.length==tindex+1){
  992. addArr.unshift(tgoods)
  993. referenceDosageQty=referenceDosageQty-tgoods.capacity
  994. var addDta={
  995. //goodsGroupDetail:[],
  996. goodsGroupDetail:goods.goodsGroupDetail,
  997. goodsList:addArr,
  998. del:true,
  999. tpn:true,
  1000. }
  1001. addDta.goodsList.forEach(add=>{
  1002. add.del=true;
  1003. })
  1004. //console.log(addArr)
  1005. if(tindex==0){
  1006. // console.log(addDta.goodsList[0])
  1007. //list.listGoodsAll.splice(index, 1,addDta)
  1008. //console.log(list.listGoodsAll[index])
  1009. }else{
  1010. addNum++
  1011. console.log('addNum=='+addNum)
  1012. //console.log(addDta.goodsList[0])
  1013. list.listGoodsAll.splice(addNum, 0,addDta)
  1014. }
  1015. }
  1016. }
  1017. }
  1018. }
  1019. }
  1020. } )
  1021. }
  1022. }
  1023. })
  1024. }
  1025. })
  1026. })
  1027. this.mealData.splice(1,0)
  1028. console.log("处理数据")
  1029. console.log(this.mealData)
  1030. this.calculation();
  1031. },
  1032. handbook(){
  1033. uni.navigateTo({
  1034. url:'handbook?mileage='+this.maintainCarData.milage+'&liyangId='+this.maintainCarData.nLevelID
  1035. })
  1036. },
  1037. settlement(){
  1038. if(!this.isNull){
  1039. uni.showToast({
  1040. title: '您选择的有未设置价格的商品,请重新选择',
  1041. icon:'none',
  1042. duration: 5000
  1043. });
  1044. return false;
  1045. }
  1046. console.log(this.orderData)
  1047. //return false;
  1048. uni.removeStorageSync('couponData');
  1049. if(this.orderData.length>0){
  1050. /* uni.navigateTo({
  1051. url:'confirmOrder?orderData='+JSON.stringify(this.orderData)+'&currentMileage='+this.maintainCarData.milage
  1052. }) */
  1053. uni.navigateTo({
  1054. url:'orderShop?orderData='+JSON.stringify(this.orderData)+'&currentMileage='+this.maintainCarData.milage+'&brand='+this.brand
  1055. })
  1056. }
  1057. },
  1058. replace(v,index,i,replaceIndex){
  1059. //v.splice(replaceIndex, 1)
  1060. console.log(v)
  1061. console.log(replaceIndex)
  1062. v.goodsList.forEach((item,vindex)=>{
  1063. if(replaceIndex==vindex){
  1064. item.showr=false
  1065. }else{
  1066. item.showr=true
  1067. }
  1068. })
  1069. uni.removeStorageSync('replaceData');
  1070. this.replaceIndex1=index;
  1071. this.replaceIndex2=i;
  1072. uni.setStorage({
  1073. key: 'replaceDataList',
  1074. data: v,
  1075. success: function () {
  1076. uni.navigateTo({
  1077. url:'replaceGoods'
  1078. })
  1079. }
  1080. });
  1081. },
  1082. caidanClick(){
  1083. this.qingdanShow=!this.qingdanShow
  1084. },
  1085. milageEdit(){
  1086. this.maintainCarData.milage=''
  1087. },
  1088. carEdit(){
  1089. uni.navigateTo({
  1090. url:'../index/cailist?type=2'
  1091. })
  1092. }
  1093. }
  1094. }
  1095. </script>
  1096. <style scoped>
  1097. .caidanTk{
  1098. height: calc(100vh );
  1099. width: 100vw;
  1100. background: rgba(0,0,0,0.6);
  1101. position:fixed;
  1102. left: 0;
  1103. top: 0;
  1104. }
  1105. .tkCont{
  1106. height: 70vh;
  1107. /* margin-top: calc(40vh ); */
  1108. position: absolute;
  1109. left: 0;
  1110. bottom: 0;
  1111. }
  1112. .caidanTkTop{
  1113. width: 750rpx;
  1114. height: 90rpx;
  1115. background: #FFFFFF;
  1116. border-radius: 24rpx 24rpx 0px 0px;
  1117. }
  1118. .caidanTkTop{
  1119. display: flex;justify-content: space-between;
  1120. }
  1121. .topTopright{
  1122. display: flex;
  1123. padding-top: 29rpx;
  1124. }
  1125. .tkTopTitle{
  1126. line-height: 90rpx;
  1127. font-size: 30rpx;
  1128. font-weight: 600;
  1129. color: #3C3C3C;
  1130. padding-left: 24rpx;
  1131. }
  1132. .empty{
  1133. width: 86rpx;
  1134. height: 42rpx;
  1135. background: #EEEEEE;
  1136. border-radius: 21rpx;
  1137. text-align: center;
  1138. color: #666666;
  1139. font-size: 24rpx;
  1140. line-height: 42rpx;
  1141. }
  1142. .close{
  1143. color: #999999;
  1144. font-size: 30rpx;
  1145. padding-right: 30rpx;
  1146. padding-left: 24rpx;
  1147. }
  1148. .tkMain{
  1149. background: #F0F0F0;
  1150. height: calc(70vh - 90rpx);
  1151. }
  1152. .tkMainSv{
  1153. padding: 0 24rpx;
  1154. width: 702rpx;
  1155. height: calc(70vh - 150rpx);
  1156. }
  1157. .goodsItemRight{
  1158. width: 520rpx;
  1159. padding-left: 20rpx;
  1160. display: flex;
  1161. flex-direction:column;
  1162. justify-content: space-between;
  1163. }
  1164. .goodsItemBottom{
  1165. display: flex;
  1166. justify-content: space-between;
  1167. }
  1168. .goodssalePrice{
  1169. font-size: 32rpx;font-weight: 500;color: #FF4F00;
  1170. }
  1171. .goodsNum{
  1172. font-size: 24rpx;font-weight: 400;color: #999999;
  1173. }
  1174. .top{
  1175. background: #FF4F00;
  1176. display: flex;
  1177. justify-content: space-between;
  1178. padding: 30rpx 25rpx;
  1179. font-size: 28rpx;
  1180. color: #FFFFFF;
  1181. }
  1182. .goodsItem{
  1183. display: flex;
  1184. padding: 15rpx 0;
  1185. }
  1186. .qingdanLine{
  1187. background: #FFFFFF;
  1188. margin-top: 20rpx;
  1189. padding: 24rpx 20rpx;
  1190. border-radius: 10rpx;
  1191. }
  1192. .brandLogo{
  1193. width: 42rpx;
  1194. height: 42rpx;
  1195. padding: 0 10rpx;
  1196. }
  1197. .topLeft{
  1198. display: flex;
  1199. align-content: center;
  1200. }
  1201. .carName{
  1202. width: 61%;
  1203. }
  1204. .topEdit{
  1205. width: 22rpx;
  1206. height: 22rpx;
  1207. padding: 10rpx;
  1208. }
  1209. .topRight{
  1210. display: flex;
  1211. justify-content: flex-end;
  1212. align-items: center;
  1213. }
  1214. .topInput{
  1215. font-size: 28rpx;
  1216. color: #FFFFFF;
  1217. text-align: right;
  1218. padding-top: 3rpx;
  1219. width: 70%;
  1220. }
  1221. .maintainrecommend{
  1222. padding: 30rpx 24rpx;
  1223. display: flex;
  1224. justify-content: space-between;
  1225. border-bottom: 2rpx solid #EEEEEE;
  1226. }
  1227. .recommendTxt{
  1228. color: #3C3C3C;
  1229. font-size: 30rpx;
  1230. font-weight: 600;
  1231. }
  1232. .manual{
  1233. width: 119rpx;
  1234. height: 40rpx;
  1235. border-radius: 20rpx;
  1236. border: 2rpx solid #F19D01;
  1237. text-align: center;
  1238. line-height: 40rpx;
  1239. font-size: 22rpx;
  1240. color: #F19D01;
  1241. }
  1242. .bottom{
  1243. position: fixed;
  1244. left: 0;
  1245. bottom: 0;
  1246. width: 100vw;
  1247. height: 120rpx;
  1248. background: #FFFFFF;
  1249. box-shadow: 0px -2px 20px 0px rgba(153, 153, 153, 0.2);
  1250. padding-bottom: constant(safe-area-inset-bottom);
  1251. padding-bottom: env(safe-area-inset-bottom);
  1252. box-sizing: content-box;
  1253. z-index: 11;
  1254. }
  1255. .ckBottom{
  1256. width: 100vw;
  1257. height: 120rpx;
  1258. padding-bottom: constant(safe-area-inset-bottom);
  1259. padding-bottom: env(safe-area-inset-bottom);
  1260. box-sizing: content-box;
  1261. }
  1262. .main{
  1263. display: flex;
  1264. height: calc(100vh - 410rpx);
  1265. }
  1266. .mainscrollView{
  1267. height: calc(100vh - 410rpx);
  1268. padding-bottom: constant(safe-area-inset-bottom);
  1269. padding-bottom: env(safe-area-inset-bottom);
  1270. box-sizing: content-box;
  1271. margin-bottom: 120rpx;
  1272. }
  1273. /* #ifdef MP-WEIXIN */
  1274. .main{
  1275. display: flex;
  1276. height: calc(100vh - 310rpx);
  1277. }
  1278. .mainscrollView{
  1279. height: calc(100vh - 310rpx);
  1280. }
  1281. /* #endif */
  1282. .mainLeft{
  1283. width: 146rpx;
  1284. background: #F5F5F5;
  1285. }
  1286. .mainRight{
  1287. width: 604rpx;
  1288. }
  1289. .mainLeftLine{
  1290. color: #3C3C3C;
  1291. padding: 30rpx 20rpx;
  1292. font-size: 24rpx;
  1293. text-align: center;
  1294. position: relative;
  1295. }
  1296. .lineNum{
  1297. position: absolute;
  1298. background: #FF270A;
  1299. width: 40rpx;
  1300. height: 26rpx;
  1301. text-align: center;
  1302. line-height: 26rpx;
  1303. font-size: 20rpx;
  1304. color: #FFFFFF;
  1305. border-radius: 13rpx;
  1306. top: 10rpx;
  1307. right: 10rpx;
  1308. }
  1309. .lineLeftActive{
  1310. background: #FFFFFF;
  1311. }
  1312. .nock{
  1313. width: 22rpx;
  1314. height: 22rpx;
  1315. border-radius: 50%;
  1316. border:2px solid #AEAEAE;
  1317. margin-top: 2rpx;
  1318. margin-right: 10rpx;
  1319. }
  1320. .imgPrivacy{
  1321. width: 36rpx;
  1322. height: 36rpx;
  1323. /* margin-top: 2rpx; */
  1324. /* margin-right: 10rpx; */
  1325. }
  1326. .contTopRight{
  1327. display: flex;
  1328. align-items: center;
  1329. width: 38rpx;
  1330. height: 36rpx;
  1331. margin-right: 10rpx;
  1332. }
  1333. .mainRightLine{
  1334. padding: 20rpx 20rpx 0 20rpx;
  1335. }
  1336. .contTop{
  1337. display: flex;
  1338. justify-content: space-between;
  1339. }
  1340. .listPackgeName{
  1341. font-size: 26rpx;
  1342. font-family: PingFangSC-Regular, PingFang SC;
  1343. font-weight: 600;
  1344. color: #3C3C3C;
  1345. }
  1346. .listPackgeMs{
  1347. font-size: 22rpx;
  1348. font-family: PingFangSC-Regular, PingFang SC;
  1349. font-weight: 400;
  1350. color: #999999;
  1351. padding-top: 5rpx;
  1352. line-height: 30rpx;
  1353. }
  1354. .contZk{
  1355. border-bottom: 1px solid #EEEEEE;
  1356. padding-bottom: 20rpx;
  1357. }
  1358. .goodsImg{
  1359. width: 120rpx;
  1360. height: 120rpx;
  1361. border-radius: 11rpx;
  1362. }
  1363. .goodsItemLIne{
  1364. display: flex;
  1365. padding-top: 20rpx;
  1366. padding-bottom: 20rpx;
  1367. }
  1368. .goodsCont{
  1369. display: flex;
  1370. flex-direction:column;
  1371. justify-content: space-between;
  1372. padding-left: 20rpx;
  1373. }
  1374. .goodsContTop{
  1375. display: flex;
  1376. justify-content: space-between;
  1377. width: 400rpx;
  1378. }
  1379. .goodsItemName{
  1380. font-size: 26rpx;
  1381. font-weight: 400;
  1382. color: #3C3C3C;
  1383. width: 78%;
  1384. }
  1385. .salePrice{
  1386. font-size: 32rpx;
  1387. font-weight: 500;
  1388. color: #FF4F00;
  1389. }
  1390. .replaceBox{
  1391. width: 100rpx;
  1392. }
  1393. .replace{
  1394. width: 75rpx;
  1395. height: 37rpx;
  1396. border-radius: 19rpx;
  1397. border: 2rpx solid #B9B9B9;
  1398. text-align: center;
  1399. line-height: 35rpx;
  1400. color: #707070;
  1401. font-size: 22rpx;
  1402. margin-left: 25rpx;
  1403. }
  1404. .contZkMain{
  1405. padding-top: 20rpx;
  1406. }
  1407. .asa{
  1408. width: 44rpx;
  1409. height: 44rpx;
  1410. line-height: 44rpx;
  1411. text-align: center;
  1412. background: #F4F5F7;
  1413. font-size: 30rpx;
  1414. }
  1415. .goodsCOntBOttom{
  1416. display: flex;
  1417. justify-content: space-between;
  1418. }
  1419. .as{
  1420. display: flex;
  1421. }
  1422. .goodsPrice{
  1423. display: flex;justify-content: space-between;
  1424. padding-top: 10rpx;
  1425. }
  1426. .goodsPriceNum{
  1427. color: #F8F8F8;
  1428. font-size: 28rpx;
  1429. }
  1430. .asNum{
  1431. font-size: 24rpx;color: #333333;
  1432. padding: 0 18rpx;
  1433. height: 44rpx;
  1434. line-height: 44rpx;
  1435. background: #F4F5F7;
  1436. margin-left: 1px;
  1437. margin-right: 1px;
  1438. }
  1439. .itemNum{
  1440. font-size: 24rpx;
  1441. font-weight: 400;
  1442. color: #999999;
  1443. }
  1444. .bottom{
  1445. display: flex;
  1446. justify-content: space-between;
  1447. }
  1448. .caidanImg{
  1449. width: 50rpx;
  1450. height: 50rpx;
  1451. }
  1452. .bottomLeft{
  1453. display: flex;
  1454. }
  1455. .caidan{
  1456. padding-left: 33rpx;
  1457. padding-top: 35rpx;
  1458. padding-right: 33rpx;
  1459. position: relative;
  1460. }
  1461. .total{
  1462. position: absolute;
  1463. width: 40rpx;
  1464. height: 26rpx;
  1465. background: #FF270A;
  1466. line-height: 26rpx;
  1467. text-align: center;
  1468. color: #FFFFFF;
  1469. font-size: 20rpx;
  1470. top: 25rpx;
  1471. right: 15rpx;
  1472. border-radius: 13rpx;
  1473. }
  1474. .heji1{
  1475. font-size: 24rpx;
  1476. font-weight: 500;
  1477. color: #666666;
  1478. }
  1479. .hejiNum{
  1480. font-size: 32rpx;
  1481. font-family: PingFangSC-Medium, PingFang SC;
  1482. font-weight: 500;
  1483. color: #FF4F00;
  1484. }
  1485. .hejiMs{
  1486. font-size: 24rpx;
  1487. padding-top: 5rpx;
  1488. color: #999999;
  1489. }
  1490. .heji{
  1491. padding-top: 23rpx;
  1492. }
  1493. .settlement{
  1494. width: 203rpx;
  1495. height: 74rpx;
  1496. background: #FF4F00;
  1497. border-radius: 37rpx;
  1498. text-align: center;
  1499. line-height: 74rpx;
  1500. font-size: 30rpx;
  1501. font-family: PingFangSC-Medium, PingFang SC;
  1502. font-weight: 500;
  1503. color: #FEFFFE;
  1504. margin-top: 23rpx;
  1505. margin-right: 32rpx;
  1506. }
  1507. .nodataImg{
  1508. width: 400rpx;
  1509. padding-top: 100rpx;
  1510. }
  1511. .noTxt{
  1512. font-size: 36rpx;
  1513. color: #999999;
  1514. padding-top: 50rpx;
  1515. }
  1516. .nodataBox{
  1517. text-align: center;
  1518. }
  1519. </style>