小程序 打开方式 页面效果 表单页面 点击跳到详情页 图标 获取后台数据 进行页面渲染

 请求地址:geecg-uniapp 同源策略 数据请求 获取后台数据 ui库安装 冲突解决(3)-CSDN博客

一.uniapp转小程序  

(1)  运行微信开发工具

(2) 配置id  然后运行

 打开小程序  路径  E:\通\uniapp-jeecg\unpackage\dist\dev\mp-weixin

(5)运行

二.表单页面

<template>
  <view>
    <cu-custom bgColor="bg-gradual-blue" :isBack="true">
      <block slot="content">额外加工</block>
    </cu-custom>


    <uni-section title=" ">
      <view style="margin: 0 20px;">

        <uni-forms ref="customForm" :rules="customRules" :modelValue="customFormData">
          <uni-forms-item label="类型" required name="seType">
            <uni-data-select v-model="customFormData.seType" :localdata="range" style="width: 215px; "
                             @change="select"></uni-data-select>
          </uni-forms-item>
          <uni-forms-item label="石材编号" required name="seRknum">
            <uni-data-select style="width: 215px; " v-model="customFormData.seRknum" :localdata="candidates"></uni-data-select>
          </uni-forms-item>
          <uni-forms-item label="日期时间" required name="seDate">
            <uni-datetime-picker style="width: 215px; " type="datetime" return-type="timestamp" v-model="customFormData.seDate" />
          </uni-forms-item>
          <uni-forms-item label="长" required name="seLong">
            <!-- <input  v-model="customFormData.seLong"   placeholder="请输入长" type="number"  /> -->

            <input class="uni-input " name="input" v-model="customFormData.seLong" placeholder="请输入长"
                   @input="fpNumInput" />
          </uni-forms-item>
          <uni-forms-item label="宽" required name="seWeight">
            <input class="uni-input " name="input" v-model="customFormData.seWeight" placeholder="请输入宽"
                   type="number" @input="fpNumInputseWeight" />
          </uni-forms-item>
          <uni-forms-item label="高" required name="seHeight">
            <input class="uni-input " name="input" v-model="customFormData.seHeight" placeholder="请输入高"
                   type="number" @input="fpNumInputseHeight" />
          </uni-forms-item>
          <uni-forms-item label="数量" required name="seNum">
            <input class="uni-input " name="input" v-model="customFormData.seNum" placeholder="请输入数量"
                   type="number" @input="fpNumInputseNum" />
          </uni-forms-item>
          <uni-forms-item label="面积" required name="seMj">
            <input class="uni-input " name="input" v-model="customFormData.seMj" placeholder="请输入面积"
                   type="number" @input="fpNumInputseMj" />
          </uni-forms-item>
          <uni-forms-item label="体积" required name="seTj">
            <input class="uni-input " name="input" v-model="customFormData.seTj" placeholder="请输入体积"
                   type="number" @input="fpNumInputseTj" />
          </uni-forms-item>
          <uni-forms-item label="额外加工" required name="sePromed">
            <uni-data-select style="width: 215px; " v-model="customFormData.sePromed" :localdata="sePromed"></uni-data-select>
          </uni-forms-item>

          <uni-forms-item label="机组" required name="seSet">
            <uni-data-select style="width: 215px; " v-model="customFormData.seSet" :localdata="seSets"></uni-data-select>
          </uni-forms-item>
          <uni-forms-item label="单价" required name="sePrice">
            <input class="uni-input " name="input" v-model="customFormData.sePrice" placeholder="请输入单价"
                   type="number" @input="fpNumInputsePrice" />
          </uni-forms-item>
          <uni-forms-item label="总价">
            <input class="uni-input " name="input" v-model="customFormData.seZprice" placeholder="请输入总价"
                   type="number" @input="fpNumInputseZprice" />
          </uni-forms-item>
          <uni-forms-item label="人员" required name="sePerson">
            <uni-data-select style="width: 215px; " v-model="customFormData.sePerson" :localdata="sePerson"></uni-data-select>
          </uni-forms-item>
          <uni-forms-item label="操作人">
            <uni-easyinput v-model="customFormData.seOpuser" placeholder="请输入操作人" disabled  style="width: 215px; "/>
            <!-- <input class="uni-input " v-model="customFormData.seOpuser" placeholder="请输入操作人" disabled /> -->
          </uni-forms-item>
          <uni-forms-item label="图片" required name="sePic">

            <uni-file-picker v-model="imageValue" fileMediatype="image" mode="grid" @select="upload"
                             @delete="delIMG" title="最多选择3张图片" :auto-upload='false' limit="3"></uni-file-picker>

          </uni-forms-item>
          <uni-forms-item label="备注">
            <uni-easyinput style="width: 215px; " type="textarea" v-model="customFormData.seRemake" placeholder="请输入备注" />
          </uni-forms-item>


        </uni-forms>
        <button type="primary" @click="submit('customForm')" style='background-color: blue;'>提交</button>
      </view>
    </uni-section>
  </view>
</template>
<script>
export default {
  data() {
    return {
      imgURL: '',
      imageValue: [],
      imageUrls: [],

      tableDatafinish: [],
      // 定义初始数据  绑定类型   :localdata="range"
      range: [{
        value: 1,
        text: "荒料"
      },
        {
          value: 2,
          text: "板材成品"
        },
        {
          value: 3,
          text: "板材半成品"
        },
        {
          value: 4,
          text: "路边石成品"
        },
        {
          value: 5,
          text: "路边石半成品"
        },
        {
          value: 6,
          text: "界石成品"
        },
        {
          value: 7,
          text: "界石半成品"
        }
      ],
      // 定义初始数据  绑定石材编号   :localdata="candidates"
      candidates: [],

      // 定义初始数据  绑定机组   :localdata="seSet"
      seSets: [],

      // 定义初始数据  绑定机组   :localdata="seSet"
      sePerson: [],

      sePromed: [],

      // 定义初始数据  绑定输入框  获取输入数据   v-model="customFormData.xxx" aa
      customFormData: {
        seType: '',
        seRknum: '',
        seDate: new Date(),
        seLong: '',
        seWeight: '',
        seHeight: '',
        seNum: '',
        seMj: '',
        seTj: '',
        sePromed: '',
        seSet: '',
        sePrice: '',
        seZprice: '',
        sePerson: '',
        seOpuser: '',
        seRemake: '',
        sePic: ''
      },
      customRules: {

        seType: {
          rules: [{
            required: true,
            errorMessage: '石材编号不能为空'
          }]
        },
        seRknum: {
          rules: [{
            required: true,
            errorMessage: '石材编号不能为空'
          }]
        },
        seDate: {
          rules: [{
            required: true,
            errorMessage: '时间不能为空'
          }]
        },
        seLong: {
          rules: [{
            required: true,
            errorMessage: '长度不能为空'
          }]
        },
        // seLong: [
        // 		 { required: true, message: '请再次输入密码', trigger: 'blur' },
        // 		          { pattern: /^\S{6,15}$/, message: '请输入 6 ~ 15 位的非空字符', trigger: 'blur' },

        // ],
        seWeight: {
          rules: [{
            required: true,
            errorMessage: '宽度不能为空'
          }]
        },
        seHeight: {
          rules: [{
            required: true,
            errorMessage: '高度不能为空'
          }]
        },
        seNum: {
          rules: [{
            required: true,
            errorMessage: '数量不能为空'
          }]
        },
        seMj: {
          rules: [{
            required: true,
            errorMessage: '面积不能为空'
          }]
        },
        seTj: {
          rules: [{
            required: true,
            errorMessage: '体积不能为空'
          }]
        },
        sePromed: {
          rules: [{
            required: true,
            errorMessage: '额外加工不能为空'
          }]
        },
        seSet: {
          rules: [{
            required: true,
            errorMessage: '机组不能为空'
          }]
        },
        sePrice: {
          rules: [{
            required: true,
            errorMessage: '单价不能为空'
          }]
        },
        sePerson: {
          rules: [{
            required: true,
            errorMessage: '人员不能为空'
          }]
        },
      },
    }
  },

  mounted() {
    // 机组
    let url33 = '/ewjg/smsEwjg/gztj';
    this.$http.get(url33).then(res => {
      console.log(res.data.result)

      res.data.result.records.forEach(value => { //循环 添加到 candidates
        this.seSets.push({
          value: value.seSet,
          text: value.seSet_dictText
        })
      })

      res.data.result.records.forEach(value => { //循环 添加到 candidates
        this.sePerson.push({
          value: value.sePerson,
          text: value.sePerson_dictText
        })
      })

      res.data.result.records.forEach(value => { //循环 添加到 candidates
        this.sePromed.push({
          value: value.sePromed,
          text: value.sePromed_dictText
        })
      })
    })
  },
  methods: {
    fpNumInput(e) {
      const o = e.target;
      const inputRule = /[^\d]/g
      this.$nextTick(function() {
        this.customFormData.seLong = o.value.replace(inputRule, '');
      })
    },

    fpNumInputseWeight(e) {
      const o = e.target;
      const inputRule = /[^\d]/g
      this.$nextTick(function() {
        this.customFormData.seWeight = o.value.replace(inputRule, '');
      })
    },

    fpNumInputseHeight(e) {
      const o = e.target;
      const inputRule = /[^\d]/g
      this.$nextTick(function() {
        this.customFormData.seHeight = o.value.replace(inputRule, '');
      })
    },

    fpNumInputseNum(e) {
      const o = e.target;
      const inputRule = /[^\d]/g
      this.$nextTick(function() {
        this.customFormData.seNum = o.value.replace(inputRule, '');
      })
    },

    fpNumInputseMj(e) {
      const o = e.target;
      const inputRule = /[^\d]/g
      this.$nextTick(function() {
        this.customFormData.seMj = o.value.replace(inputRule, '');
      })
    },


    fpNumInputseTj(e) {
      const o = e.target;
      const inputRule = /[^\d]/g
      this.$nextTick(function() {
        this.customFormData.seTj = o.value.replace(inputRule, '');
      })
    },

    fpNumInputsePrice(e) {
      const o = e.target;
      const inputRule = /[^\d]/g
      this.$nextTick(function() {
        this.customFormData.sePrice = o.value.replace(inputRule, '');
      })
    },

    fpNumInputseZprice(e) {
      const o = e.target;
      const inputRule = /[^\d]/g
      this.$nextTick(function() {
        this.customFormData.seZprice = o.value.replace(inputRule, '');
      })
    },



    // 获取上传状态
    upload(e) {
      this.imageValue.push(e.tempFiles[0])
    },
    delIMG(e) {
      const index = this.imageValue.findIndex(v => v.url === e.tempFilePath);
      if (index !== -1) {
        this.imageValue.splice(index, 1);
      }
    },
    submitImage() {
      if (this.imageValue.length != 0) {
        const uploadPromises = this.imageValue.map(val => {

          const formData = {
            biz: 'temp',
          };
          return new Promise((resolve, reject) => {
            uni.uploadFile({
              url: 'http://43.138.31.228:1888/jeecg-boot/sys/common/upload',
              formData: formData,
              filePath: val.path,
              name: 'file',
              fileType: 'image',
              fileName: val.name,
              success: (uploadFileRes) => {
                var jsonObject = JSON.parse(uploadFileRes.data);
                const imageUrl = jsonObject.message;
                this.imageUrls.push(imageUrl); // 将每次上传的图片链接添加到数组中
                if (this.imageUrls.length > 1) {
                  this.customFormData.sePic = this.imageUrls.join(',');
                } else {
                  this.customFormData.sePic = imageUrl
                }
                resolve();
              },
              fail: (err) => {
                reject(err);
              }
            });
          });
        });
        this.imageUrls = []
        return Promise.all(uploadPromises)
      } else {
        this.customFormData.sePic = '';
        return Promise.resolve(); // 如果没有上传图片,直接返回一个已解决的Promise对象
      }
    },

    select() {

      let url3 = '/cwkhfk/cwKhfk/scxxList';
      let params = {
        type: this.value //定义 this.value 赋值给type  最后parmas
      }
      this.$http.get(url3, {
        params: params //定义赋值  params = parmas
      }).then(res => {
        // this.candidates = res.data.result
        res.data.result.forEach(value => { //循环 添加到 candidates
          this.candidates.push({
            value: value.number,
            text: value.number
          })
        })


      })
    },
    async submit(ref) {
		console.log('tijiao')

      // await this.submitImage();

      // console.log(this.customFormData.sePic)

      // //添加上传
      // let customFormData = this.customFormData
      // // 获取数据进行添加
      // let url = '/ewjg/smsEwjg/add';
      // var params = customFormData //定义赋值  params = customFormData  后端带着parmas去后端
      // this.$http.post(url, params).then(res => {
      //   this.customFormData = res.data.result
      // })
      // this.customFormData = ''
      // this.$refs[ref].validate().then(res => {
      //   console.log('success', res);
      //   uni.showToast({
      //     title: `校验通过`
      //   })
      // }).catch(err => {
      //   console.log('err', err);
      // })

    },
  }
}
</script>

<style>
.uni-input {
  width: 215px;
  font-size: 12px;
  height: 35px;
  border: 1px solid #dedede;
  padding: 0 5px;
  border-radius: 5px;
}
</style>

二. 点击跳到详情页

 父页面


 
 <template>
 	<view class="order-list">
 
 			<cu-custom bgColor="bg-gradual-blue" :isBack="true">
 				<block slot="content">荒料管理</block>
 			</cu-custom>
 
 		<view class="" >
 			<!-- 订单展示 -->
 			<mescroll-uni ref="mescrollRef" @init="mescrollInit" top="60rpx" @down="downCallback" @up="upCallback">
 				<!-- 数据列表 -->
 				<view class="data-list" style=" margin-top: 2rem;">
 					<!-- 空内容展示-->
 					<u-empty :text="textNoMore" v-if="dataList.length==0" mode="list"></u-empty>
 					<!-- 空内容展示End-->
 					<view class="order margin-top-sm" v-for="(item, aindex) in dataList" :key="item.id"
 						@click="jumpToOrder(item)">
 						<view class='bg-white padding-sm flex padding-right-zero flex-between'>
 			
 							<view class='flex-sub  radius text-left text-xs margin-top-xs'>
 								<image src="../../static/common/huang.png"
 									style="width: 100rpx;height: 80rpx;margin-top: -10px;"></image>
 							</view>
 							<view class='flex-sub  radius text-left text-xs margin-top-xs'
 								 style="margin-left: -200px;font-size: 12px;">
 								编号:{{ item.sbwWarehousingNumber}}</view>
 						</view>
 			
 						<view class="bg-white padding-sm solid-top" >
 							<view class='padding-top-sm text-sm flex'>
 							<view class="left-title"  style="font-size: 12px;">日期:</view><view class="right-content"  style="font-size: 12px;">{{ item.sbwWarehousingDate}}</view>					
 							</view>
 							<view class='padding-top-sm text-sm flex'></view>
 						</view>
 			
 					</view>
 					<!-- 返回顶部 -->
 					<u-back-top :scroll-top="scrollTop" top="600">
 					</u-back-top>
 					<!-- 返回顶部End -->
 				</view>
 			</mescroll-uni>
 			
 		</view>
 
 		<!-- 订单展示完毕End -->
 	</view>
 </template>
 
 <script>
 	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
 	import configService from '@/common/service/config.service.js';
 	export default {
 		mixins: [MescrollMixin],
 		data() {
 			return {
 				pageable: {
 					pageIndex: 0,
 					pageSize: 10
 				},
 				list: [{
 					complainantStatus: '0',
 					name: '待解决'
 				
 				}, {
 					complainantStatus: '10',
 					name: '已解决'
 		
 				}],
 			    textNoMore :'-- 没有更多数据了 --',
 				tabCurrent: 0,
 				scrollTop: 0,
 				dataList: [],
 			}
 		},
 
 		methods: {
 
 			//下拉刷新
 			downCallback() {
 				this.mescroll.scrollTo(0, 0)
 				this.mescroll.resetUpScroll();
 			},
 			//上拉加载
 			async upCallback(pages) {
 				let pageIndex = pages.num // 页码, 默认从1开始
 				let pageSize = pages.size // 页长, 默认每页10条
 				this.pageable.pageIndex = pageIndex
 				this.pageable.pageSize = pageSize
 				let data = await this.getOrder(this.pageable)
 				console.log("data" + data)
 				const curPageData = data.records || []
 				if (data && curPageData.length > 0) {
 					const curPageLen = curPageData.length // 当前数据长度
 					const totalPage = data.total // 获取接口总共有多少页
 					this.mescroll.endByPage(curPageLen, totalPage);
 				} else {
 					this.mescroll.endErr()
 				}
 			},
 			//订单列表
 			async getOrder(pageable) {
 				let that = this
 				let params = {
 					openid: uni.getStorageSync("openId"),
 					complainantStatus: this.list[this.tabCurrent].complainantStatus,
 					pageNo: pageable.pageIndex,
 					pageSize: pageable.pageSize
 				}
 				// console.log(params)
 				let preData = {
 					records: []
 				}
				// 获取列表数据 
 				await that.$http.get('/block/smsBlockWarehousing/list', {
 					params: params
 				}).then(res => {
 					console.log(res)
 					if (res.data.success !== true) {
 						that.$tip.alert(res.data.message)
 					} else {
 						if (pageable.pageIndex < 2)
 							that.dataList = [] // 如果是第一页需手动置空列表
 						that.dataList.push(...res.data.result.records)  //数据添加到dataList
 						console.log(res.data.result)
 						preData = res.data.result;
 					}
 				}).catch(err => {
 					// that.$tip.alert("网络波动,请重试!")
 					console.log("err")
 				})
 				console.log(preData)
 				return preData
 			},
 			
			// 点击跳转到huangliao页面 携带当前点击的id 过去
 			jumpToOrder(item) {
 				// console.log(item, 'adad')
 				uni.navigateTo({
 					url: '/pages/common/huangliao?id=' + item.id
 				})
 			},
 		
 
 		}
 	}
 </script>
 

子页面


<template>
	<view style="background-color: #ffffff;">
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="content">荒料详情</block>
		</cu-custom>
		<u-form :model="form" ref="uForm">
			<view class="container">

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ; display: flex;">入库编号 :<span
						style="color:#666;">{{form.sbwWarehousingNumber}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">入库日期 :<span
						style="color:#666;">{{form.sbwWarehousingDate}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">荒料种类 :<span
						style="color:#666;">{{form.sbwName_dictText}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">长 :<span
						style="color:#666;">{{form.sbwLong}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">宽 :<span
						style="color:#666;">{{form.sbwWidth}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">高 :<span
						style="color:#666;">{{form.sbwTall}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">体积 :<span
						style="color:#666;">{{form.sbwSbwVolume}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">颜色 :<span
						style="color:#666;">{{form.sbwColor_dictText}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">价格 :<span
						style="color:#666;">{{form.sbwPrice}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">数量 :<span
						style="color:#666;">{{form.sbwNum}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">运单单价 :<span
						style="color:#666;">{{form.sbwFreightPrice}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">运费 :<span
						style="color:#666;">{{form.sbwFreight}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">运输人 :<span
						style="color:#666;">{{form.sbwTransporter_dictText}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">总价 :<span
						style="color:#666;">{{form.sbwNum}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">料场 :<span
						style="color:#666;">{{form.sbwFreight}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">操作员 :<span
						style="color:#666;">{{form.sbwTransporter_dictText}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">图片 :<!-- <span
						style="color:#666;">{{form.sbwPic}}</span> -->
					<image src="form.sbwPic" mode=""></image>
				</view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>

				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">文件 :<span
						style="color:#666;">{{form.sbwFile}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
				<view style="margin-top: 5px; font-size: 13px;padding:10px 15px ;">备注 :<span
						style="color:#666;">{{form.sbwRemake}}</span></view>
				<view style="border: #e5e5e5 1px solid; margin: 10px;;"></view>
			</view>
		</u-form>

	</view>
</template>

<script>
	export default {
		data() {
			return {

				form: {
					sbwWarehousingDate: '',
					sbwWarehousingNumber: '',
					sbwName_dictText: '',
					sbwLong: '',
					sbwWidth: '',
					sbwTall: '',
					sbwSbwVolume: '',
					sbwColor_dictText: '',
					sbwPrice: '',
					sbwNum: '',
					sbwFreightPrice: '',
					sbwFreight: '',

					sbwTransporter_dictText: '',
					sbwTotalPrice: '',
					sbwStockyard_dictText: '',
					sbwPic: '',
					sbwFile: '',
					sbwRemake: ''
				},

			}
		},

		onLoad: function(options) {

			this.getOrderDetail()

		},

		methods: {


			// 接受数据
			async getOrderDetail() {
				let that = this
				let params = {
					id: this.id
				}
				console.log(params)
				//return 
				await this.$http.get('/block/smsBlockWarehousing/list', {
					params: params
				}).then(res => {
					console.log("get RES")
					console.log(res.data.result.records[0], '马甲的喇嘛是的')
					if (res.data.success !== true) {
						that.form = res.data.result.records[0]
						that.$tip.alert(res.data.message)
					} else {
						that.form = res.data.result.records[0]
						if (that.form.complaintFileString) {
							that.fileList = that.form.complaintFileString.split(",")
						}
						console.log(that.fileList)
					}
				}).catch(err => {
					// that.$tip.alert("网络波动,请重试!")
					console.log(err)
				})
			},


		}
	}
</script>

三.图标

<template>
		<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="content">出库统计图</block>
		</cu-custom>
		<view>
			 <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#3a82f8"></uni-segmented-control>
		</view>
  <view class="charts-box">
    <qiun-data-charts 
      type="pie"
      :opts="opts"
      :chartData="chartData"
    />
	<qiun-data-charts
	  type="mount"
	  :opts="opt"
	  :chartData="chartData"
	/>
  </view>
    </view>
</template>

<script>
import { forEach } from '../../common/luch-request/utils';
export default {
  data() {
    return {
	items: ['日', '月', '年'],
	current: 0,
    chartData: {},
      //您可以通过修改 config-ucharts.js 文件中下标为 ['pie'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
     
	  // 饼图
	  opts: {
        color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
        // padding: [15,5,5,5],
        // enableScroll: false,
		// legend: {
		// 	show:true,
		// 	lineHeight:20
		// },
        // extra: {
        //   pie: {
        //     activeOpacity: 0.5,
        //     activeRadius: 10,
        //     offsetAngle: 0,
        //     labelWidth: 15,
        //     border: true,
        //     borderWidth: 3,
        //     borderColor: "#FFFFFF"
        //   }
        // }
      },
	  
	  // 条形图
	  opt: {
	          color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
	   //        padding: [15,10,0,5],
	   //        enableScroll: false,
	   //        legend: {
				//   show:false,
				
			 //  },
	   //        xAxis: {
	   //          disableGrid: true,
				// rotateLabel:true,
				// rotateAngle:"45",
	   //        },
	   //        yAxis: {
	   //          data: [
	   //            {
	   //              min: 0
	   //            }
	   //          ]
	   //        },
	   //        extra: {
	   //          mount: {
	   //            type: "bar",
	   //            widthRatio: 0.3,
	   //            borderWidth: 0,
	   //            barBorderRadius: [
	   //              50,
	   //              50,
	   //              50,
	   //              50
	   //            ],
	   //            linearType: "custom"
	   //          }
	   //        }
	        }
	      };
    
  },
	
  mounted() {
	  var today = new Date();   // 日
	  var yesterday = new Date(today.getTime()); // 月
	  this.getServerData(yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate(),'0') //年
  },
  methods: {
	  // 定义方法  和值 (item,type)
	async getServerData(item,type) {
			let that = this
			let params = {
				item: item,  //自己定义的值  和后端的值要对应  问后端
				type: type
			}
			// 请求数据  携带 params
			await that.$http.get('/totalView/totalView/PieChuKu',{params: params}).then(res => {
				   // 计算总值  reduce 累加  
				   // 在括号内的箭头函数(acc, item) => acc + item.value是reduce方法所接受的函数。这个箭头函数接收两个参数,acc表示累加器(accumulator),item表示当前正在处理的数组元素。箭头函数的功能是将累加器acc和当前元素的value属性相加,并返回相加的结果。

                   //最后的, 0表示reduce方法的初始值为0。这意味着在开始累加之前,累加器acc的初始值为0。
				   const totalValue = res.data.result.reduce((acc, item) => acc + item.value, 0);
				   // console.log(totalValue,'asasasasa')
				   
				   // 计算占比并更新数组
				   // console.log(res.data.result,'dadsada')
				   
				   
				   // 判断数据 要是是0  要么是有数值
				   // 如果totalValue值 等于0  就循环遍历渲染
				   if(totalValue==0){
					   res.data.result.forEach(item => {
					     item.labelText = '0%';  //强制数值变成0%  不写的话 就平均分成6份   因为有6份
					   });
				   }
				  else{
					  // 如果不是  就截取后两位  拼接上%
					  res.data.result.forEach(item => {
					    const percentage = (item.value / totalValue) * 100;  //获取的数值× 100
					  	item.labelText = percentage.toFixed(2)+"%";   //然后 拼接上%
					  });
				  }
				  
				  
				  // ress是一个包含series属性的对象。
// series是一个包含一个对象的数组。
// 这个对象包含一个名为data的属性,其值为res.data.result,假设res是一个包含data属性的对象,而data属性包含一个名为result的数组。
					   let ress = {
					       series: [
					         {
					   		data:res.data.result
					   	  }
					       ]
						   
					     };
						 this.chartData = JSON.parse(JSON.stringify(ress));
						 
				   
			}).catch(err => {
			    console.log(err,"err")
			})
	 },
	 onClickItem(e) {
	       if (this.current != e.currentIndex) {
	         this.current = e.currentIndex;
			 if(this.current=="0"){
				 // var today = new Date(); 创建了一个Date对象,表示当前的日期和时间。它会将当前的日期和时间信息存储在today变量中。

// console.log(today,'sasasasa') 打印出了today的值,以及额外的字符串sasasasa到控制台。这里主要是用来调试和查看today的值。

// var yesterday = new Date(today.getTime()); 创建了另一个Date对象,其时间戳(以毫秒为单位的时间值)与today相同。这意味着yesterday代表的是和today相同的日期和时间。

// this.getServerData(yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate(),'2'); 这行代码调用了一个名为getServerData的方法,并传递了两个参数。第一个参数是一个表示日期的字符串,格式为"年-月-日",通过yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate()获取。第二个参数是字符串'2'。
				 var today = new Date();
				 var yesterday = new Date(today.getTime());
			     this.getServerData(yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate(),'0')
			 }
	
			 if(this.current=="1"){
			 	var today = new Date();
			 	var yesterday = new Date(today.getTime());
			 	this.getServerData(yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate(),'1');
			 }
			 
			 if(this.current=="2"){
			 	var today = new Date();  //显示
				console.log(today,'sasasasa')
			 	var yesterday = new Date(today.getTime());
			 	this.getServerData(yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate(),'2');
			 }  
	       }
	     }
  }
};
</script>

<style scoped>
  /* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
  .charts-box {
    width: 100%;
    height: 230px;
  }
</style>

地址:演示 - uCharts跨平台图表库 

 五,获取后台数据 进行页面渲染

案例一

(1)代码展示


  <template>
  	<view>
  		<cu-custom bgColor="bg-gradual-pink" :isBack="true">
  			<block slot="content">荒料管理</block>
  		</cu-custom>
  		<view class="uni-container">
  			<uni-table border stripe emptyText="暂无更多数据">
  				<uni-tr style="background-color:#ebebeb;">
  					<uni-th width="150" align="center">序号</uni-th>
  					<uni-th width="150" align="center">入库编号</uni-th>
  					<uni-th align="center">日期</uni-th>
  					<uni-th align="center">荒料种类</uni-th>
  					<uni-th align="center">长</uni-th>
  					<uni-th align="center">宽</uni-th>
  					<uni-th align="center">高</uni-th>
  					<uni-th align="center">体积</uni-th>
  					<uni-th align="center">颜色</uni-th>
  					<uni-th align="center">价格</uni-th>
  					<uni-th align="center">数量</uni-th>
  					<uni-th align="center">运单单价</uni-th>
  					<uni-th align="center">运费</uni-th>
  					<uni-th width="204" align="center">运输人</uni-th>
  					<uni-th width="204" align="center">总价</uni-th>
  					<uni-th width="204" align="center">料场</uni-th>
  					<uni-th align="center">操作员</uni-th>
  					<uni-th align="center">图片</uni-th>
  					<uni-th align="center">文件</uni-th>
  					<uni-th align="center">备注</uni-th>
  				</uni-tr>
  				<uni-tr v-for="(item, index) in tableData" :key="index">
  					<uni-td>{{index+1}}</uni-td>
  					<uni-td>
  						<view class="name">{{ item.sbwWarehousingNumber}}</view>
  					</uni-td>
  					<uni-td align="center">{{ item.sbwWarehousingDate}}</uni-td>
  					<uni-td align="center">{{ item.sbwName_dictText }}</uni-td>
  					<uni-td align="center">{{ item.sbwLong }}</uni-td>
  					<uni-td align="center">{{ item.sbwWidth }}</uni-td>
  					<uni-td align="center">{{ item.sbwTall }}</uni-td>
  					<uni-td align="center">{{ item.sbwSbwVolume }}</uni-td>
  					<uni-td align="center">{{ item.sbwColor_dictText }}</uni-td>
  					<uni-td align="center">{{ item.sbwPrice }}</uni-td>
  					<uni-td align="center">{{ item.sbwNum }}</uni-td>
  					<uni-td align="center">{{ item.sbwFreightPrice }}</uni-td>
  					<uni-td align="center">{{ item.sbwFreight }}</uni-td>
  					<uni-td align="center">{{ item.sbwTransporter_dictText }}</uni-td>
  					
  					<uni-td align="center">{{ item.sbwTotalPrice }}</uni-td>
  					<uni-td align="center">{{ item.sbwStockyard_dictText }}</uni-td>
  					<uni-td align="center">{{ item.sbwTransporter_dictText }}</uni-td>
  					<uni-td align="center">{{ item.sbwPic }}</uni-td>
  					<uni-td align="center">{{ item.sbwFile }}</uni-td>
  					<uni-td align="center">{{ item.sbwRemake }}</uni-td>
  				</uni-tr>
  			</uni-table>
			<p>总数据量{{this.total}}</p>
  			<view class="uni-pagination-box"><uni-pagination show-icon :page-size="pageSize" :current="pageCurrent"
  					:total="total" @change="change" /></view>
  		</view>
  	</view>
  </template>
  
  <script>
  export default {
  	data() {
  		return {
  			searchVal: '',
  			tableData: [],
  			// 每页数据量
  			pageSize: 10,
  			// 当前页
  			pageCurrent: 1,
  			// 数据总量
  			total: 0,
  		
  		}
  	},
  	onLoad() {
  		this.selectedIndexs = []
  		this.getData(1)  //初始化默认第一页
  	},
  	methods: {
  		
  		// 分页触发
  		change(e) {
  			
  			// this.selectedIndexs.length = 0
  		
  			this.getData(e.current)  //点击出发 :current="pageCurrent"  当前页
  		},
  	
  		// 获取数据
  		getData(pageCurrent) {
			// 定义请求数据  然后通过路径带到后端返回需要的数据
  			this.pageCurrent = pageCurrent
  			let pageNo=this.pageCurrent  //当前页
  			let pageSize=this.pageSize //每页数据量
  			
			// 路径拼接数据 发送到后端 获取翻页的数据和效果
  			let url = '/block/smsBlockWarehousing/list?pageNo='+pageNo+"&pageSize="+pageSize;
  			this.$http.get(url).then(res => {
  				this.tableData = res.data.result.records
  				this.total=res.data.result.total;  //总数据量
  		
  				// console.log('结果', res.data.result.records)
  			})
  			
  		},
  	}
  }
  </script>
 

(2)页面展示

案例二

(1)代码展示
<template>
	<view>
		<cu-custom bgColor="bg-gradual-pink" :isBack="true">
			<block slot="content">路边石管理</block>
		</cu-custom>

		<uni-section title="">
			<view>
				<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" />
			</view>
			<view class="content">
				<view v-if="current === 0">
					<uni-table border stripe emptyText="暂无更多数据">
						<uni-tr style="background-color:#ebebeb;">
							<uni-th width="100" align="center">序号</uni-th>
							<uni-th width="204" align="center">入库编号</uni-th>
							<uni-th align="center" width="204">库存日期</uni-th>
							<uni-th width="150" align="center">长(m)</uni-th>
							<uni-th width="150" align="center">宽(m)</uni-th>
							<uni-th width="150" align="center">高(m)</uni-th>
							<uni-th width="150" align="center">数量</uni-th>
							<uni-th width="150" align="center">单价</uni-th>
							<uni-th width="150" align="center">体积(㎡)</uni-th>
							<uni-th width="204" align="center">加工费</uni-th>
							<uni-th width="150" align="center">颜色</uni-th>
							<uni-th width="150" align="center">机组</uni-th>
							<uni-th width="150" align="center">人员</uni-th>
							<uni-th width="204" align="center">操作员</uni-th>
							<uni-th width="204" align="center">图片</uni-th>
							<uni-th width="150" align="center">文件</uni-th>
							<uni-th width="204" align="center">备注</uni-th>
						</uni-tr>
						<uni-tr v-for="(item, index) in tableData" :key="index">
							<uni-td>{{index+1}}</uni-td>
							<uni-td align="center">{{ item.sskwRkid }}</uni-td>
							<uni-td align="center">{{ item.sskwDate }}</uni-td>
							<uni-td align="center">{{ item.sskwLong }}</uni-td>
							<uni-td align="center">{{ item.sskwWight }}</uni-td>
							<uni-td align="center">{{ item.sskwHight }}</uni-td>
							<uni-td align="center">{{ item.sskwNum }}</uni-td>
							<uni-td align="center">{{ item.sskwPrice }}</uni-td>
							<uni-td align="center">{{ item.sskwVolume }}</uni-td>
							<uni-td align="center">{{ item.sskwWages }}</uni-td>
							<uni-td align="center">{{item.sskwColor_dictText}}</uni-td>
							<uni-td align="center">{{item.sskwSet_dictText}}</uni-td>
							<uni-td align="center">{{ item.sskwPromed_dictText }}</uni-td>
							<uni-td align="center">{{ item.sskwOpuser }}</uni-td>
							<uni-td align="center"><img :src="item.sabwPic" /></uni-td>

							<uni-td align="center">{{ item.sskwFile }}</uni-td>
							<uni-td align="center">{{ item.sskwRemake }}</uni-td>
						</uni-tr>
					</uni-table>
					<view class="uni-pagination-box"><uni-pagination show-icon :page-size="pageSize"
							:current="pageCurrent" :total="total" @change="change" /></view>
				</view>
				<view v-if="current === 1">
					<uni-table border stripe emptyText="暂无更多数据">
						<uni-tr style="background-color:#ebebeb;">
							<uni-th width="100" align="center">序号</uni-th>
							<uni-th width="204" align="center">入库编号</uni-th>
							<uni-th align="center" width="204">库存日期</uni-th>
							<uni-th width="150" align="center">长(m)</uni-th>
							<uni-th width="150" align="center">宽(m)</uni-th>
							<uni-th width="150" align="center">高(m)</uni-th>
							<uni-th width="150" align="center">数量</uni-th>
							<uni-th width="150" align="center">单价</uni-th>
							<uni-th width="150" align="center">体积(㎡)</uni-th>
							<uni-th width="204" align="center">加工费</uni-th>
							<uni-th width="150" align="center">颜色</uni-th>
							<uni-th width="150" align="center">机组</uni-th>
							<uni-th width="150" align="center">人员</uni-th>
							<uni-th width="204" align="center">操作员</uni-th>
							<uni-th width="150" align="center">加工方式</uni-th>
							<uni-th width="204" align="center">图片</uni-th>
							<uni-th width="150" align="center">文件</uni-th>
							<uni-th width="204" align="center">备注</uni-th>
						</uni-tr>
						<uni-tr v-for="(item, index) in tableData2" :key="index">
							<uni-td>{{index+1}}</uni-td>
							<uni-td>
								<view class="name">{{ item.skwRkid }}</view>
							</uni-td>
							<uni-td align="center">{{ item.skwDate }}</uni-td>
							<uni-td align="center">{{ item.skwLong }}</uni-td>
							<uni-td align="center">{{ item.skwWight}}</uni-td>
							<uni-td align="center">{{ item.skwHight }}</uni-td>
							<uni-td align="center">{{ item.skwNum }}</uni-td>
							<uni-td align="center">{{ item.skwPrice}}</uni-td>
							<uni-td align="center">{{ item.skwVolume }}</uni-td>
							<uni-td align="center">{{ item.skwWages }}</uni-td>
							<uni-td align="center">{{item.skwColor_dictText}}</uni-td>
							<uni-td align="center">{{item.skwSet_dictText}}</uni-td>
							<uni-td align="center">{{ item.skwPerson_dictText }}</uni-td>
							<uni-td align="center">{{ item.skwOpuser }}</uni-td>
							<uni-td align="center">{{ item.skwPromed_dictText}}</uni-td>
							<uni-td align="center"><img :src="item.skwPic" /></uni-td>
							<uni-td align="center">{{ item.skwFile }}</uni-td>
							<uni-td align="center">{{ item.skwRemake }}</uni-td>
						</uni-tr>
					</uni-table>
					<view class="uni-pagination-box"><uni-pagination show-icon :page-size="pageSize2"
							:current="pageCurrent2" :total="total2" @change="changeChengpin" /></view>
				</view>
			</view>
		</uni-section>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				tableData: [], //半成品获取数据
				tableData2: [], //成品获取数据
				// 每页数据量
				pageSize: 7,
				pageSize2: 7,
				// 当前页
				pageCurrent: 1,
				pageCurrent2: 1,
				// 数据总量
				total: 0,
				total2:0,
				loading: false,
				current: 0,
				current2: 0,
				items: ['半成品展示', '成品展示'],
			}
		},
		// 初始值
		onLoad() {
			// this.getRemote()
			this.selectedIndexs = []
			this.getData(1)
			this.getData2(1)
		},
		// 方法
		methods: {
			// 点击切换展示页面
			onClickItem(e) {
				if (this.current !== e.currentIndex) {
					this.current = e.currentIndex
				}
			},
			// 分页触发
			change(e) {
				// this.$refs.table.clearSelection()
				this.selectedIndexs.length = 0
				this.getData(e.current) //半成品
				
			},
			changeChengpin(e) {
				// this.$refs.table.clearSelection()
				this.selectedIndexs.length = 0
				this.getData2(e.current) //成品
			},


			// 半成品获取数据
			getData(pageCurrent) {
				this.loading = true
				this.pageCurrent = pageCurrent
				let pageNo = this.pageCurrent
				let pageSize = this.pageSize

				let url = '/sakerb/smsSaKerbWarehousing/list?pageNo=' + pageNo + "&pageSize=" + pageSize;
				this.$http.get(url).then(res => {
					this.tableData = res.data.result.records
					this.total = res.data.result.total;
					// console.log('结果', res.data.result.records)
				});
			},

			


			// 成品获取数据
			getData2(pageCurrent2) {
				this.loading = true
				this.pageCurrent2 = pageCurrent2
				let pageNo = this.pageCurrent2
				let pageSize = this.pageSize2
			

				let url2 = '/kerb/smsKerbWarehousing/list?pageNo=' + pageNo + "&pageSize=" + pageSize;
				this.$http.get(url2).then(res => {
					this.tableData2 = res.data.result.records
					this.total2 = res.data.result.total;
					// console.log('结果', res.data.result.records)
				})
			}
			// 成品伪request请求 
			
		}
	}
</script>
(2)页面展示

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/124077.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

MySQL -- mysql connect

MySQL – mysql connect 文章目录 MySQL -- mysql connect一、Connector/C 使用1.环境安装2.尝试链接mysql client 二、MySQL接口1.初始化2.链接数据库3.下发mysql命令4.获取执行结果5.关闭mysql链接6.在C语言中连接MySQL 三、MySQL图形化界面推荐 使用C接口库来进行连接 一、…

ppt聚光灯效果

1.放入三张图片内容或其他 2.全选复制成图片 3.设置黑色矩形&#xff0c;透明度30% 4.粘贴复制后的图片&#xff0c;制定图层 5.插入椭圆&#xff0c;先选中矩形&#xff0c;再选中椭圆&#xff0c;点击绘图工具&#xff0c;选择相交即可&#xff08;关键&#xff09;

python二维码识别系统的设计与实现

大家好我是玥沐春风&#xff0c;今天分享一个python二维码识别系统的设计与实现&#xff0c;项目源码以及部署相关请联系我&#xff0c;文末附上联系信息 。 项目简介&#xff1a; 本项目是在对二维码的应用服务场景进行了深入的分析&#xff0c;通过利用Python技术来开发一款…

警告:未配置spring boot 配置注解处理器

前言 这是我在这个网站整理的笔记,有错误的地方请指出&#xff0c;关注我&#xff0c;接下来还会持续更新。 作者&#xff1a;神的孩子都在歌唱 问题 我再使用ConfigurationProperties(prefix “redisson”)去加载配置文件中的属性的时候&#xff0c;发现idea有个警告 并且配…

uni-app基于vue实现商城小程序

目录 一、前言 二、功能效果图 1.首页 2.分类 ​3.活动 4.我的 ​5.商品详情 6.购物车 三、代码实现 1.项目结构截图 uni-app&#xff0c;Hbuilder 2.首页源码 3.数据模拟通讯 四、总结 一、前言 参考“网易严选”小程序 项目采用传统vue项目结构&#xff0c;即u…

【123. 买卖股票的最佳时机 III】

目录 一、题目描述二、算法原理三、代码实现 一、题目描述 二、算法原理 三、代码实现 class Solution { public:const int Init-0x3f3f3f3f;int maxProfit(vector<int>& prices) {int nprices.size();vector<vector<int>> f(n,vector<int>(3,Ini…

python开发过程中注意编码规范~

文章目录 一、 代码编排二、 文档编排三、 空格的使用四、 注释五、 文档描述六、 命名规范总体原则&#xff0c;新编代码必须按下面命名风格进行&#xff0c;现有库的编码尽量保持风格。七 编码建议关于Python技术储备一、Python所有方向的学习路线二、Python基础学习视频三、…

SpectralDiff论文阅读笔记

高光谱图像分类是遥感领域的一个重要问题&#xff0c;在地球科学中有着广泛的应用。近年来&#xff0c;人们提出了大量基于深度学习的HSI分类方法。然而&#xff0c;现有方法处理高维、高冗余和复杂数据的能力有限&#xff0c;这使得捕获数据的光谱空间分布和样本之间的关系具有…

MySQL -- 用户管理

MySQL – 用户管理 文章目录 MySQL -- 用户管理一、用户1.用户信息2.创建用户3.删除用户4.远端登录MySQL5.修改用户密码6.数据库的权限 一、用户 1.用户信息 MySQL中的用户&#xff0c;都存储在系统数据库mysql的user表中&#xff1a; host&#xff1a; 表示这个用户可以从…

windows系统下查看安卓apk的sha1

1.在apk所在文件夹打开cmd或者powershell 2.输入 certutil -hashfile xxx.apk SHA1 这样就可以了 3.指令格式 certutil -hashfile FileName [HashAlgorithm] certutil -hashfile&#xff1a;原样输入 FileName&#xff1a;文件名 HashAlgorithm&#xff1a;可选项包括&…

【unity实战】Unity实现2D人物双击疾跑

最终效果 前言 我们要实现的功能是双击疾跑&#xff0c;当玩家快速地按下同一个移动键两次时能进入跑步状态 我假设快速按下的定义为0.2秒内&#xff0c;按下同一按键两次 简单的分析一下需求&#xff0c;实现它的关键在于获得按键按下的时间&#xff0c;我们需要知道第一次…

ArcGIS进阶:水源涵养功能分级评价操作

首先抛出水源涵养重要性评价的公式&#xff1a;水源涵养量降雨量-蒸散发量-地表径流量&#xff0c;其中地表径流量降雨量*平均地表径流系数 声明&#xff1a;以下数据来源于来自于牛强老师书籍&#xff08;城乡规划GIS技术&#xff09;。 以下给出重要性评价阈值表&#xff1…

什么是final修饰 使用final修饰类、方法、变量的区别?

简介: 变量成为常量&#xff0c;不允许修改 当final修饰类时&#xff0c;该类变为最终类&#xff08;或称为不可继承的类&#xff09;。不能从最终类派生子类。这样做的目的是为了防止其他类修改或扩展最终类的行为。当final修饰方法时&#xff0c;该方法成为最终方法&#xf…

采集Prestashop独立站

这是一个用Lua编写的爬虫程序&#xff0c;用于采集Prestashop独立站的内容。爬虫程序使用代理信息&#xff1a;proxy_host: jshk.com.cn。 -- 首先&#xff0c;我们需要导入所需的库 local http require(socket.http) local url require(socket.url)-- 然后&#xff0c;我们…

集合框架:List系列集合:特点、方法、遍历方式、ArrayList,LinkList的底层原理

目录 List集合 特有方法 遍历方式 1. 使用普通 for 循环&#xff1a; 2. 使用增强型 for 循环&#xff08;foreach&#xff09;&#xff1a; 3. 使用迭代器&#xff08;Iterator&#xff09;&#xff1a; 4. 使用 Java 8 的流&#xff08;Stream&#xff09;API&#xff…

Python按类别和比例从Labelme数据集中划分出训练数据集和测试数据集

Python按类别和比例从Labelme数据集中划分出训练数据集和测试数据集 前言前提条件相关介绍实验环境按类别和比例从Labelme数据集中划分出训练数据集和测试数据集代码实现输出结果 前言 由于本人水平有限&#xff0c;难免出现错漏&#xff0c;敬请批评改正。更多精彩内容&#x…

六大排序算法:插入、选择、冒泡、快排、希尔、归并

1、插入排序 解析&#xff1a;第一个元素设定为已经排好序&#xff0c;依次选择后续的元素插入到已经排好序的组内进行排序。 图示&#xff1a; 代码&#xff1a; public static void insertionSort(int[] arr) {int n arr.length;for (int i 1; i < n; i) {int key a…

视频剪辑高手的秘诀:如何从视频中提取封面,提高视频点击率

在视频分享平台上&#xff0c;一个吸引人的封面往往能吸引更多的观众点击。一个好的封面可以传达视频的主题&#xff0c;吸引人们的兴趣&#xff0c;提高视频的点击率。那么&#xff0c;如何从视频中提取封面呢&#xff1f;下面&#xff0c;让我们一起来看看云炫AI智剪如何操作…

计算机网络期末复习-Part1

1、列举几种接入网技术&#xff1a;ADSL&#xff0c;HFC&#xff0c;FTTH&#xff0c;LAN&#xff0c;WLAN ADSL&#xff08;Asymmetric Digital Subscriber Line&#xff09;&#xff1a;非对称数字用户线路。ADSL 是一种用于通过电话线连接到互联网的技术&#xff0c;它提供…